Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main() {
  6. ofstream f("BAC.TXT");
  7. int n, x, p=2;
  8. cin>>n;
  9.  
  10. // 3 5 8 9 12
  11.  
  12. for(int i=0; i<n; i++){
  13. cin>>x;
  14. while(p<x)
  15. p=p*2;
  16. f<<p<<" ";
  17. }
  18.  
  19.  
  20.  
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement