提交时间:2024-08-14 17:50:37

运行 ID: 50213

#include<bits/stdc++.h> using namespace std; bool palindrome(string s){ int i=0,j=s.size()-1; while(i<=j){ if(s[i]==s[j]){ i++; j--; }else return false; } return true; } int main() { string s; cin>>s; if(palindrome(s)){ cout<<"yes"; }else cout<<"no"; return 0; }