Palindromes _easy version
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21875 Accepted Submission(s): 13625
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i,n,c; char a[100]; while(scanf("%d",&n)!=EOF) { getchar(); while(n--) { gets(a); c=strlen(a)-1; for(i=0;i<strlen(a);i++) { if(a[i]==a[c]) c--; else break; } if(i==strlen(a)) printf("yes\n"); else printf("no\n"); } } return 0; }