/*请输入字符串:1202112021:是.请输入字符串:11:是.请输入字符串:1212:不是.请输入字符串:12331233:不是.请输入字符串:1221122112211221:是.请输入字符串:^ZPressanykeytocontinue*/#include #include int main() {int s,i,flag;char a[100];while(printf("请输入字符串:"),scanf("%s",a) == 1) {s = strlen(a);flag = 1;for(i = 0; i < s/2 && flag; i++)if(a[i] != a[s - i - 1])flag = 0;if(flag) printf("%s:是.\n",a);else printf("%s:不是.\n",a);fflush(stdin);}return 0;}
温馨提示:答案为网友推荐,仅供参考