参考代码:
#include"bits/stdc++.h" using namespace std; char str[280]; bool check(char *s,int a,int b){ while(a!=b&&s[a]==s[b]){ a++; b--; } //abccba if(a>=b) return true; else return false; } int main(){ cin>>str; if(check(str,0,strlen(str)-1)) cout<<"Y"; else cout<<"N"; return 0; }
0.0分
0 人评分