Advertisement
owlachno

gg

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