Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- int main()
- {
- int t;
- cin>>t;
- int i,j;
- while(t>0)
- {
- string str;
- cin>>str;
- int k=str.size()-1;
- int flag=0;
- for(i=0,j=k;i<=k/2;i++,j--)
- {
- if(str[i]!=str[j])
- {
- flag=1; //
- break;
- }
- }
- if(flag==1)
- {
- cout<<"NO\n";
- }
- else {cout<<"YES\n";}
- t--;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement