#include
#include
int main()
{
char str[100];
printf("请输入:");
gets(str);
int len = strlen(str);
int flag = 0;
for (int start = 0, end = len - 1; start <= end; start++, end--)
{
if (str[start] != str[end])
break;
flag = 1;
}
if (flag == 0)
{
printf("不是回文!\n");
return 1;
}
printf("是回文!\n");
return 0;
}
#include
void main() { int x,y,z;
scanf("%d",&x); z=x; y=0; while ( z ) { y*=10; y+=z%10; z/=10; }
if ( x==y ) printf("%d是回文数。\n",x); else printf("%d不是回文数。\n",x);
}