fork download
  1. #include <stdio.h>
  2.  
  3. //関数のプロトタイプ宣言
  4. int max(int x, int y);
  5.  
  6. //main関数
  7. int main(void) {
  8. int a, b, c, d;
  9. scanf("%d %d %d %d", &a, &b, &c, &d);
  10.  
  11. // max関数の入れ子で最大値を求める
  12. printf("最大値 = %d\n", max(max(a, b), max(c, d)));
  13.  
  14. return 0;
  15. }
  16.  
  17. //max関数の定義
  18. int max(int x, int y){
  19. return (x > y) ? x : y;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
最大値 = 2114629648