fork download
  1. #include <stdio.h>
  2.  
  3. int max(int x, int y);
  4.  
  5.  
  6. int main(void){
  7. int a, b, c, d;
  8. scanf("%d %d %d %d", &a, &b, &c, &d);
  9. printf("%d, %d, %d, %dの中で最大値は%dである", a, b, c, d, max(max(a, b), max(c,d)));
  10. return 0;
  11. }
  12.  
  13. int max(int x, int y)
  14. {
  15. return (x>y)?x:y;
  16. }
  17.  
Success #stdin #stdout 0s 5284KB
stdin
4
50
90
2
stdout
4, 50, 90, 2の中で最大値は90である