Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
44154 | lnx | 判断字符串是否为回文 | C++ | 通过 | 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; }