Advertisement
Guest User

11

a guest
Jan 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int x, y;
  7.     cout << "x = " << endl;
  8.     cin >> x;
  9.     cout << "y = " << endl;
  10.     cin >> y;
  11.     bool k = 0;
  12.     if ((x == y + 1) || (y == x + 1)) {
  13.         k = 1;
  14.     }
  15.     cout << k;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement