Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, c, d, e;
- cin >> a >> b;
- if (a % 2 == 0)
- {
- cout << a << " ";
- c = a;
- while (c < b)
- {
- c = a;
- a = c + 2;
- cout << a << " ";
- c = a;
- }
- }
- else
- {
- d = a + 1;
- cout << d << " ";
- c = d;
- a = d;
- e = b - 1;
- while (c < e)
- {
- c = a;
- a = c + 2;
- cout << a << " ";
- c = a;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement