想看題目請點我
#include <iostream> using namespace std; int main() { string s1 ,s2; while(cin >> s1 ) { for(int i = 1 ; i <= s1.length() ; i++) { s2 += s1[s1.length()-i] ; } if(s1==s2) cout << "yes" << endl ; else cout << "no" << endl ; s2 = ""; } return 0; }