fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void optimal(int arrsize)
  5. {
  6. cout << '0' <<endl;
  7. int code=0;
  8. for (int i = 0; i < arrsize ; i++) {
  9. ++code;
  10. code *= 10;
  11. cout << code << endl;
  12. }
  13. }
  14.  
  15. int main() {
  16. optimal(5);
  17. return 0;
  18. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
0
10
110
1110
11110
111110