Advertisement
Guest User

Untitled

a guest
May 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int max(int a, int b) {
  4.     return a > b;
  5. }
  6. int main() {
  7.     float N, M;
  8.     cin >> N >> M;
  9.     float med = (N + M) / 2 + 1;
  10.     int dif = max(N - M, M - N);
  11.     for (int i = med - dif / 2; i <= med + (dif + 1) / 2; ++i) {
  12.         cout << i << endl;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement