fork download
  1. #include <stdio.h>
  2.  
  3. // 関数のプロトタイプ宣言
  4. int max(int x, int y);
  5.  
  6. int main(void) {
  7. int a, b, c, d;
  8.  
  9. scanf("%d %d %d %d", &a, &b, &c, &d);
  10.  
  11. printf("一番大きな数は: %d\n", max(max(a, b), max(c, d)));
  12.  
  13. return 0;
  14. }
  15.  
  16. int max(int x, int y) {
  17. return (x > y) ? x:y;
  18. }
Success #stdin #stdout 0s 5280KB
stdin
1 4 7 3
stdout
一番大きな数は: 7