fork download
  1. #include <stdio.h>
  2. //関数のプロトタイプ宣言
  3. //ここ↓を埋めてね1
  4. int max(int x, int y);
  5.  
  6. //main関数
  7. int main(void)
  8. {
  9.  
  10. int a=1; int b=5; int c=3; int d=4;
  11. int result;
  12.  
  13. result = max(max(a,b), max(c,d));
  14.  
  15. printf("最大値は %d\n", result);
  16.  
  17. return 0;
  18.  
  19. }
  20.  
  21. //max関数の定義
  22. int max(int x, int y)
  23. {
  24.  
  25. if(x>y)
  26. {
  27. return x;
  28.  
  29. }
  30. else
  31. {
  32. return y;
  33. }
  34.  
  35.  
  36. }
  37.  
  38.  
  39.  
  40.  
  41.  
Success #stdin #stdout 0s 5288KB
stdin
stdout
最大値は 5