fork download
  1. #include <stdio.h>
  2. //課題B-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.  
  11. for(int m=1;m<=n;m++){
  12.  
  13. printf("*");
  14. }
  15.  
  16. //ここまでを書けばできます
  17. printf("\n");
  18. }
  19.  
  20. int main(void) {
  21. int i;
  22. for(i = 0; i < 5; i++)
  23. print_star(i);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
0  
1  *
2  **
3  ***
4  ****