fork download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. int t;
  7. scanf("%d",&t);
  8. while(t--){
  9. char a[11];
  10. scanf("%s",a);
  11. int l=0,h=strlen(a)-1,i;
  12. for(i=0;i<=h;i++){
  13. if(a[i++] == a[h--]){
  14. l=1;
  15. break;
  16. }
  17. }
  18. if(l == 1){
  19. printf("YES\n");
  20. }
  21. else{
  22. printf("NO\n");
  23. }
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty