题解 | #回文字符串#
回文字符串
https://www.nowcoder.com/practice/df00c27320b24278b9c25f6bb1e2f3b8
#include<iostream> #include<string> using namespace std; int main(){ string str; while (cin >> str){ string rev; for (int i = 0; i < str.size(); i++){ rev.insert(0,1,str[i]); } if (rev == str){ printf("Yes!\n"); } else{ printf("No!\n"); } } }