3 条题解
题解与来源题共享。已有题解默认通过;新增或编辑后需由来源域管理员审核。待审核、驳回题解仅作者和审核管理员可见。来源域:system
-
0
#include <iostream #include <string using namespace std;
int main() { string s; getline(cin, s); // 读取整行,包含空格
int left = 0; int right = s.length() - 1; bool isPal = true; while (left < right) { if (s[left] != s[right]) { isPal = false; break; } left++; right--; } cout << (isPal ? "yes" : "no") << endl; return 0;}
信息
- ID
- 319
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 入门
- 标签
- 递交数
- 331
- 已通过
- 192
- 上传者