| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 61446 | 冯纪尧 | 回文字符串I | C++ | Accepted | 1 MS | 284 KB | 397 | 2023-12-09 15:34:00 |
#include <iostream> #include <string> using namespace std; bool isPalindrome(const string& s) { int left = 0; int right = s.length() - 1; while (left < right) { if (s[left] != s[right]) { return false; } left++; right--; } return true; } int main() { string input; cin >> input; if (isPalindrome(input)) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }