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