fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int a;
  7.  
  8. while (true)
  9. {
  10. cin >> a;
  11. if (a == 0)
  12. {
  13. break;
  14. }
  15. if (a / 10000 != 0)
  16. {
  17. if (a / 10000 == a % 10)
  18. {
  19. if ((a / 1000) % 10 == (a % 100) / 10)
  20. {
  21. cout << "yes" << "\n";
  22. }
  23. else
  24. cout << "no" << "\n";
  25. }
  26. else
  27. cout << "no" << "\n";
  28. }
  29. else if (a / 1000 != 0)
  30. {
  31. if (a / 1000 == a % 10)
  32. {
  33. if ((a / 100) / 10 == (a % 100) / 10)
  34. {
  35. cout << "yes" << "\n";
  36. }
  37. else
  38. cout << "no" << "\n";
  39. }
  40. else
  41. cout << "no" << "\n";
  42. }
  43. else if (a / 100 != 0)
  44. {
  45. if (a / 100 == a % 10)
  46. {
  47. cout << "yes" << "\n";
  48. }
  49. else
  50. cout << "no" << "\n";
  51. }
  52. else if (a / 10 != 0)
  53. {
  54. if (a / 10 == a % 10)
  55. {
  56. cout << "yes" << "\n";
  57. }
  58. else
  59. cout << "no" << "\n";
  60. }
  61. else
  62. cout << "yes" << "\n";
  63. }
  64. return 0;
  65. }
Success #stdin #stdout 0.01s 5308KB
stdin
1211
0
stdout
yes