Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44154 | lnx | 判断字符串是否为回文 | C++ | Accepted | 0 MS | 240 KB | 258 | 2024-03-29 15:05:39 |
#include<bits/stdc++.h> using namespace std; int main() { char ch[100]; cin>>ch; bool flag=1; int len=strlen(ch); for(int i=0;i<len;i++){ if(ch[i]==ch[len-i]) flag=0; } if(flag) cout<<"yes"; else cout<<"no"; return 0; }