#include<bits/stdc++.h> using namespace std; const int N=110; char s[N]; int main() { cin.getline(s,N); int n=strlen(s); for(int i=0,j=n-1;i<j;i++,j--) //首尾往中靠 { if(s[i]!=s[j]) //不相同 { cout<<"no"; return 0; } } cout<<"yes"; return 0; }
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; string s1=s; reverse(s1.begin(),s1.end()); if(s1==s) cout<<"yes"; else cout<<"no"; return 0; }
#include <bits/stdc++.h> using namespace std; const int N=10; char s[N]; int main() { cin.getline(s,N); int n=strlen(s); for(int i=0,j=n-1;i<j;i++,j--) { if(s[i]!=s[j]) { cout<<"no"; return 0; } } cout<<"yes"; return 0; }
#include<bits/stdc++.h> using namespace std; const int N=1000; char s[N]; int main() { cin.getline(s,N); int n=strlen(s); for(int i=0,j=n-1;i<j;i++,j--) { if(s[i]!=s[j]) { cout<<"no"; return 0; } } cout<<"yes"; return 0; }
Using your lizikid universal account