fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3.  
  4. int main(void) {
  5. int t,i,n;
  6. scanf("%d",&t);
  7. while(t--)
  8. { char c[20];
  9. gets(c);
  10. n=0;
  11. for(i=0;i<strlen(c);i++)
  12. {
  13. if(c[i]!=c[strlen(c)-i-1])
  14. {n=1;break;}
  15. }
  16. if(n==0)
  17. printf("YES\n");
  18. else
  19. printf("NO\n");
  20.  
  21. }
  22. // your code goes here
  23. return 0;
  24. }
Success #stdin #stdout 0s 4520KB
stdin
3
abc
aba
a
stdout
YES
NO
YES