/*烟台大学计算机学院学生
*All right reserved.
*文件名称:数据结构——回文字符串
*作者:杨飞
*完成日期:2014年8月228日
*版本号:v1.0
*对任务及求解方法的描述部分:数据结构——回文字符串
*我的程序:*/
#include <iostream>
#include <cstring>
#include <cstdio>
#include <iomanip>
using namespace std;
int main()
{
char word[10000];
bool flag=true;
cin>>word;
int n;
n=strlen(word);
for(int i=0;i<n/2;i++)
{
if(word[i]!=word[n-i-1])
{
flag=false;
break;
}
}
if(flag==true)
cout<<"是回文数"<<endl;
else
cout<<"不是回文数"<<endl;
return 0;
}
运行结果:
心得体会无: