题解 | #回文字符串#
回文字符串
https://www.nowcoder.com/practice/df00c27320b24278b9c25f6bb1e2f3b8
#include <stdio.h>
#include <string.h>
int main() {
char a[2000];
while (scanf("%s ", a) != EOF) {
int i=strlen(a);int j=0;i=i-1;int tag=1;
while(1){
if(a[i]!=a[j]){
tag=0;
break;
}
i--;j++;
if(i<=j)break;
}
if(tag==1){printf("Yes!\n");}
else{printf("No!\n");}
}
return 0;
}
