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