Run ID:115634
提交时间:2025-04-01 21:26:30
#include <iostream> #include <string> using namespace std; bool isPalindrome(const string &s, int start, int end) { while (start < end) { if (s[start] != s[end]) { return false; } start++; end--; } return true; } int main() { string s; cin >> s; int n = s.length(); for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { if (isPalindrome(s, i, j)) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; return 0; }