Advertisement
mercMatvey4

Untitled

Feb 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. //3
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. setlocale(LC_ALL,"");
  9. cout << "Натуральное число : ";
  10. int a;
  11. cin >> a;
  12. int b = 0, c = a;
  13. while (c > 0)
  14. {
  15. b = (b*10) + c % 10;
  16. c = c / 10;
  17. }
  18. if (a == b) cout << "Число " << a << " - перевертыш";
  19. else cout << "Число " << a << " - не перевертыш";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement