fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main(void){
  6. while(1){
  7. int flag = 0;
  8. string str;
  9. getline(cin, str);
  10.  
  11. if(str == "0")
  12. return 0;
  13.  
  14. for(int i = 0; i < str.length() / 2; i++){
  15. if(str[i] != str[str.length() - i - 1]){
  16. flag = 1;
  17. cout << "no\n";
  18. break;
  19. }
  20. }
  21.  
  22. if(flag == 0)
  23. cout << "yes\n";
  24. }
  25. }
Success #stdin #stdout 0.01s 5668KB
stdin
9
97
13931
0
stdout
yes
no
yes