fork download
  1. #include <stdio.h>
  2.  
  3. void print_number(int n){
  4. printf("%-3d", n);
  5. }
  6.  
  7. void print_star(int n){
  8. print_number(n);
  9.  
  10. int j;
  11. for(j= 0;j<n;j++)
  12. print_star(j);
  13.  
  14. printf("\n");
  15. }
  16.  
  17. int main(void) {
  18. int i;
  19. for(i = 0; i < 5; i++)
  20. print_star(i);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
0  
1  0  

2  0  
1  0  


3  0  
1  0  

2  0  
1  0  



4  0  
1  0  

2  0  
1  0  


3  0  
1  0  

2  0  
1  0