artemgf

В одном шаге от счастья

Mar 18th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string>
  4. #include <math.h>
  5. #include <algorithm>
  6. #include <vector>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     int c, a, i,o,p;
  13.  
  14.     cin >> a;
  15.  
  16.     c = 0;
  17.     c = a % 1000 + 1;
  18.     i = a % 1000 - 1;
  19.     a = a / 1000;
  20.  
  21.     if (c % 10 + (c % 100) / 10 + c / 100  == a % 10 + (a % 100) / 10 + a / 100 || i % 10 + (i % 100) / 10 + i / 100 == a % 10 + (a % 100) / 10 + a / 100)
  22.         cout << "Yes";
  23.     else
  24.         cout << "No";
  25.  
  26.     _getch();
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment