fork download
  1. #include <stdio.h>
  2. double max(double x, double y);
  3. int main(void) {
  4. double a, b, max_val;
  5.  
  6. printf("2つの数を入力してください: ");
  7. scanf("%lf %lf", &a, &b);
  8. max_val = max(a, b);
  9. printf("大きい方の値は: %f\n", max_val);
  10.  
  11. return 0;
  12. }
  13. double max(double x, double y){
  14. if (x > y) {
  15. return x;
  16. } else {
  17. return y;
  18. }
  19. }
  20.  
  21.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
2つの数を入力してください: 大きい方の値は: 0.000000