网站公告列表

  没有公告

加入收藏
设为首页
联系我们
您现在的位置: 山东在线 >> 生活百问 >> 电脑互联网 >> 软件开发 >> 正文
  A Question of C++ Programming?           ★★★
A Question of C++ Programming?
作者:软件开发… 文章来源:阿达 更新时间:2008-4-9 0:26:55
A Question of C++ Programming? A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following five-digit integers is a palindrome:12321,55555,45554 and 11611. Write a program that reads in a five-digit integer and determines whether it is a palindrome.(Hint:Use the division and modulus operators to separate the number into its individual digits.)
    #include "string.h"
#include "stdio.h"
#define MAX 100
bool fun(char *str)
{
int len,i;
len=strlen(str);
for(i=0;i<len/2;i++)
if(str[i]!=str[len-1-i])
return false;
return true;
}

void main()
{
char s[MAX];
gets(s);
if(fun(s))
printf("yes");
else
printf("no");
}
揪错 ┆ 评论 ┆ 举报 提问者对答案的评价:
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:

  • 中国历史上那些从没有…

    隆裕皇后与光绪帝唯一…

    丰盈的女性 为孙中山夫…

    被遗忘的女性 孙中山的…
     请帮我指点前期战斗副本天赋
     休闲野德装备收集指南
     猎人全按键键盘设置
     实在是看不下去了
     我个人的野性平衡德天赋
     纯副本输出平衡德天赋
     小白的术士天赋
     请高人点评我的竞技场天赋
    【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    专 题 栏 目
    最 新 热 门
    最 新 推 荐
    相 关 文 章
    没有相关文章
    山东在线 Copyright@2006-2008 鲁ICP备07018514号 中国网通集团公司山东省分公司