题解 | #回文字符串#
回文字符串
https://www.nowcoder.com/practice/df00c27320b24278b9c25f6bb1e2f3b8
#include "bits/stdc++.h" using namespace std; int main() { bool flag= true; string str; while(getline(cin,str)) { for (int i = 0; i < str.size(); ++i) { if (str[i]!=str[str.size()-i-1]) { flag= false; } } if (flag) { cout<<"Yes!"<<endl; } else{ cout<<"No!"<<endl; } } }