Guest User

Untitled

a guest
Jul 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. int s[32], i, N;
  8. cin >> N;
  9.  
  10. for(int i=0; i<N; i++)
  11. cin >> s[i];
  12.  
  13. cout << log(N);
  14. int stop = (int)(log(N));
  15. //cout << stop;
  16. for(int i=0; i<pow(2, stop)-1; i++)
  17. cout << i*2+1 << ", ";
  18.  
  19.  
  20. }
Add Comment
Please, Sign In to add comment