fork download
  1. #include <stdio.h>
  2.  
  3. double max(double x, double y);
  4.  
  5. int main(void) {
  6. double a, b, c, d;
  7.  
  8. a = 3.2;
  9. b = 7.5;
  10. c = 2.1;
  11. d = 5.8;
  12.  
  13. printf("最大値は %.1f です\n", max(max(a, b), max(c, d)));
  14.  
  15. return 0;
  16. }
  17.  
  18. double max(double x, double y) {
  19. return (x > y) ? x : y;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
最大値は 7.5 です