fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long n;
  6. cin >> n;
  7. long long x=1;
  8. while (x<=n) {
  9. cout<<x<<endl;
  10. x*=2;
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5304KB
stdin
16
stdout
1
2
4
8
16