#include #include #include using namespace std; // 优化后的判断字符串是否为回文串函数bool isPalindrome(const string& s) { int len = s.length(); for (int i = 0; i < len / 2; i++) { if (s[i]!= s[len - 1 - i]) { return false; } } return true;} int main() { int n; cin >> n; string s; for (int i = 0; i < n; i++) { cin >> s; int len = s.length(); bool found = false; for (int subLen = 2; subLen < len; subLen++) { if (subLen >= 2 && isPalindrome(s.substr(0, subLen))) { if (isPalindrome(s.substr(subLen)) && len - subLen >= 2) { found = true; break; } } } if (found) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0;}