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