Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44309 | tangjunze | 判断字符串是否为回文 | C++ | Accepted | 1 MS | 252 KB | 256 | 2024-03-29 20:18:52 |
#include<iostream> #include<cstring> using namespace std; int main() { char s[100]; gets(s); int i=0; int j=strlen(s)-1; while((i<j)&&(s[i]==s[j])){ i++; j--; } if(i>=j){ cout<<"yes"; } else{ cout<<"no"; } return 0; }