Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
12216 | 徐一喆 | 【字符串】回文串 | C++ | Accepted | 2 MS | 732 KB | 332 | 2021-05-20 12:20:02 |
#include<bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { string str2 = str; int j = 0, len = str.length(); for (int i = len - 1; i >= 0; i--) { str2[len - i - 1] = str[i]; } if (str == str2) { cout << "YES" << endl; } else cout << "NO" << endl; } return 0; }