| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 80964 | sh25_zhangyy | 判断字符串是否为回文 | C++ | 通过 | 0 MS | 252 KB | 497 | 2026-01-04 15:36:36 |
#include <iostream> #include <string> using namespace std; bool isPalindrome(const string& str) { int left = 0; int right = str.length() - 1; while (left < right) { if (str[left] != str[right]) { return false; } left++; right--; } return true; } int main() { string input; cin >> input; if (isPalindrome(input)) { cout << "yes"; } else { cout << "no"; } return 0; }