fork download
  1. #include <stdio.h>
  2. //関数のプロトタイプ宣言
  3. int max(int x, int y);
  4. //main関数
  5. int main(void) {
  6. int a,b,c,d;
  7. a = 1;
  8. b = 5;
  9. c = 3;
  10. d = 4;
  11. printf("最大値 = %d\n", max( max(a, b), max(c, d) ));
  12. return 0;
  13. }
  14. //max関数の定義
  15. int max(int x, int y){
  16. return (x > y) ? x : y;
  17. }
  18.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
最大値 = 5