判断回文字符数组

发布时间 2023-08-31 10:11:35作者: 江南王小帅

#include<iostream>
#include<cstring>
#include<algorithm>
#include<ctime>


using namespace std;

 
const int MAXN=10010;
 

int main() 
{

    char s[MAXN];
int i=0,n=0;
while( (s[n]=getchar() ) !='\n')
{
    n++;
}

n--;

while(s[i] == s[n-i])
    i++;
if(i>n/2) cout<<"Yes"<<endl;
else cout<<"NO"<<endl;

    
    

 system("pause") ;

return 0;
}