Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97216 | zzx99001 | 回文字符串I | C++ | Wrong Answer | 1 MS | 272 KB | 504 | 2024-11-10 22:24:13 |
#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; cout << "请输入一个字符串: "; cin >> input; if (isPalindrome(input)) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
------Input------
ltpffytlohuaoofsqawhbfrvtppczdnumeicqcsvfgjvydqhhuuhhqdyvjgfvscqciemundzcpptvrfbhwaqsfooauholtyffptl
------Answer-----
Yes
------Your output-----
请输入一个字符串: Yes