fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. for(int i = 0 ; i < 5 ; i++){
  7. for(int j = 0 ; j <=i ; j++){
  8. cout << j+1 << " ";
  9. }
  10. cout << '\n';
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
1 
1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5