双指针
#include<bits/stdc++.h>
using namespace std;
char a[1000];
int main()
{
cin.getline(a,1000); int s=strlen(a),r=0,l=s-1; while(r<l) { if(a[r++]==a[l--]) { cout<<"yes"; return 0; } else { cout<<"no"; return 0; } } return 0;
}
注册一个 PYYG 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 PYYG 通用账户