fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. vector<int> v {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  8. for (int x : v) {
  9. cout << x << endl;
  10. if (x) v.push_back(x / 2);
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 4496KB
stdin
Standard input is empty
stdout
1
0
1016635408
21860
5
6
7
8
9
10