fork download
  1. #include <stdio.h>
  2.  
  3. int max(int x, int y); // プロトタイプ宣言
  4.  
  5. int main(void) {
  6. int a, b, c, d;
  7.  
  8. scanf("%d %d %d %d", &a, &b, &c, &d);
  9.  
  10. int result = max(max(a, b), max(c, d));
  11.  
  12. printf("%d\n", result);
  13.  
  14. return 0;
  15. }
  16.  
  17. int max(int x, int y) {
  18. if (x > y) return x;
  19. else return y;
  20. }
  21.  
Success #stdin #stdout 0s 5320KB
stdin
1 2 3 4
stdout
4