Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- ofstream f("BAC.TXT");
- int n, x, p=2;
- cin>>n;
- // 3 5 8 9 12
- for(int i=0; i<n; i++){
- cin>>x;
- while(p<x)
- p=p*2;
- f<<p<<" ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement