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. for(int i = 0; i < n; i++) {
  11. printf("*");
  12. }
  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 5272KB
stdin
Standard input is empty
stdout
0  
1  *
2  **
3  ***
4  ****