fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n;
  7. cin>>n;
  8. for(int i=0; i<n; i++){
  9. cout<<int(pow(2,i))<<" ";
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5288KB
stdin
5
stdout
1 2 4 8 16