Advertisement
InnaSibirova

Palidrom 4x

Oct 14th, 2019
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.   int a, b, c, d;
  5.   cin >> a;
  6.   d = a % 10;
  7.   c = a / 10 % 10;
  8.   b = a / 100 % 10;
  9.   a = a / 1000;
  10.   if (a == d && b == c) {
  11.     cout << "YES";
  12.   } else {
  13.     cout << "NO";
  14.   }
  15.   return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement