提交时间:2026-01-04 15:36:36

运行 ID: 80964

#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; }