Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
49195 | teacher_lu | 判断字符串是否为回文 | C++ | Accepted | 1 MS | 256 KB | 303 | 2024-06-29 10:48:16 |
#include <bits/stdc++.h> using namespace std;int main(){ int i,n; string s; getline(cin,s); int x = s.size(); // 修改一 n = s.size() / 2; int f=1; for(int i= 0;i<=n;i++){ if(s[i] != s[x-1-i]){f=0;break; // 修改二 } } if(f==1)cout << "yes"; else cout << "no"; return 0;}