Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
37136 | 张予馨 | 判断字符串是否为回文 | C++ | 解答错误 | 1 MS | 256 KB | 311 | 2024-01-19 15:16:13 |
#include<iostream> #include<cstring> #include<string> #include<cstdio> using namespace std; int main() { char s[100]; int len,position; int i,j; gets(s); i=0; j=len-1; while((i<j)&&s[i]==s[j]){ i++; j--; } if(i>=j){ cout<<"yes"<<endl; } else cout<<"no"<<endl; return 0; }