Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
116892 | 常钰杰 | 回文字符串I | C++ | Accepted | 1 MS | 276 KB | 445 | 2025-04-12 18:23:01 |
#include<iostream> using namespace std; int main() { char str[1000]; int i=0,sum=0,flag=1; cin>>str; while(str[i]!='\0') { sum++; i++; } for(int j=0;j<=sum/2;j++) { if(str[j]!=str[sum-1-j]) { flag=0; break; } } if(flag==1) { cout<<"Yes"; } else { cout<<"No"; } return 0; }