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