Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
27622 | 唐心 | 【字符串】回文串 | C++ | Accepted | 2 MS | 716 KB | 303 | 2022-06-07 11:27:06 |
#include <iostream> #include <cstring> using namespace std; int main() { string str; cin >> str; int len = str.length(); for(int i = 0 ; i < len / 2 ; i++) { if( str[i] != str[len - 1 - i] ) { cout << "NO" << endl; return 0 ; } } cout << "YES" << endl; return 0; }