fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. auto begin = 1 ,
  6. end = 23;
  7. for( auto i = begin; i <= end; ++i ) {
  8. cout << i << " ";
  9. for( auto j = 1 ; j <= i; ++j ) {
  10. cout << j << " ";
  11. }
  12. cout << "\n";
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1 1 
2 1 2 
3 1 2 3 
4 1 2 3 4 
5 1 2 3 4 5 
6 1 2 3 4 5 6 
7 1 2 3 4 5 6 7 
8 1 2 3 4 5 6 7 8 
9 1 2 3 4 5 6 7 8 9 
10 1 2 3 4 5 6 7 8 9 10 
11 1 2 3 4 5 6 7 8 9 10 11 
12 1 2 3 4 5 6 7 8 9 10 11 12 
13 1 2 3 4 5 6 7 8 9 10 11 12 13 
14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 
18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 
19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 
20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 
22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 
23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23