Run ID:61446

提交时间: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; }