fork(1) download
  1. #include <stdio.h>
  2. //関数のプロトタイプ宣言
  3. //ここ↓を埋めてね1
  4. int max(int x,int y);
  5. //main関数
  6. int main(void) {
  7. int a,b,c,d;
  8. //ここ↓を埋めてね2
  9. int m;
  10.  
  11. a=1;
  12. b=5;
  13. c=3;
  14. d=4;
  15.  
  16. m= max(max(a,b),max(d,c));
  17. printf("%dと%dと%dと%dのうち最大値は%d",a,b,c,d,m);
  18. return 0;
  19. }
  20.  
  21. //max関数の定義
  22. int max(int x, int y){
  23. //ここ↓を埋めてね3
  24. return (x>y)? x:y;
  25. }
  26.  
  27.  
  28.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
1と5と3と4のうち最大値は5