fork download
  1. #include <stdio.h>
  2.  
  3. // ここ↓を埋めてね1(プロトタイプ宣言)
  4. int max(int x, int y);
  5.  
  6. // main関数
  7. int main(void) {
  8. int a,b,c,d;
  9.  
  10. // ここ↓を埋めてね2(値の代入と出力)
  11. a = 1;
  12. b = 5;
  13. c = 3;
  14. d = 4;
  15. printf("最大値は %d です。\n", max(max(a, b), max(c, d)));
  16.  
  17. return 0;
  18. }
  19. int max(int x, int y) {
  20. int max;
  21. max=x;
  22. if(y>=x){
  23. max=y;
  24. }
  25. return max;
  26. }
  27.  
  28.  
  29.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
最大値は 5 です。