fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string st="PA";
  6. int k=0;
  7. for (int i=0; i<st.length(); i++){
  8. if (st[i]!=st[st.length()-1-i]){
  9. k=1;
  10. break;
  11. }
  12. }
  13. if (k==0)
  14. cout<<"Yes";
  15. else
  16. cout<<"No";
  17. }
Success #stdin #stdout 0s 4724KB
stdin
Standard input is empty
stdout
No