fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int n, limit = 10, i = 1;
  6.  
  7. cin >> n;
  8.  
  9. while(i <= n){
  10. if(limit < i)break;
  11. cout << i++ << " ";
  12. }
  13. cout << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5296KB
stdin
20
stdout
1 2 3 4 5 6 7 8 9 10