Advertisement
Guest User

a1

a guest
Apr 10th, 2020
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a, b, c, d, e;
  6.  
  7.     cin >> a >> b;
  8.  
  9.     if (a % 2 == 0)
  10.     {
  11.         cout << a << " ";
  12.         c = a;
  13.         while (c < b)
  14.         {
  15.             c = a;
  16.             a = c + 2;
  17.             cout << a << " ";
  18.             c = a;
  19.         }
  20.     }
  21.     else
  22.     {
  23.         d = a + 1;
  24.         cout << d << " ";
  25.         c = d;
  26.         a = d;
  27.         e = b - 1;
  28.         while (c < e)
  29.         {
  30.             c = a;
  31.             a = c + 2;
  32.             cout << a << " ";
  33.             c = a;
  34.         }
  35.     }
  36.  
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement