fork download
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main(){
    int t;
    cin>>t;
    
    while(t--)
    {
        int i;
    string str;
    getline(cin,str);
    cout<<endl;
    int n=str.length();
    if(n&2==0)
    {
    for(i=0;i<=n/2;i++)
    {
        if(str[i]==str[n-1-i] )
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
    }
    else
    {
        for(i=0;i<n/2;i++)
        {
            if(str[i]==str[n-1-i] )
            {
            cout<<"YES"<<endl;
            }
            else
            {

            cout<<"NO"<<endl;
            } 
         
        }
    



    }
    }
    return 0;
    }
Success #stdin #stdout 0.01s 5508KB
stdin
Standard input is empty
stdout