Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97217 | zzx99001 | 回文字符串I | C++ | Accepted | 1 MS | 276 KB | 463 | 2024-11-10 22:24:24 |
#include <iostream> #include <string> using namespace std; bool isPalindrome(string str) { int n = str.length(); for (int i = 0; i < n / 2; i++) { if (str[i]!= str[n - i - 1]) { return false; } } return true; } int main() { string input; cin >> input; if (isPalindrome(input)) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }