首页 > 其他分享 >用函数求四个数中的最大数

用函数求四个数中的最大数

时间:2022-11-17 22:59:18浏览次数:34  
标签:return 函数 最大数 int max max4 max2 数中

# include<stdio.h>
int main()
{int max4(int a,int b,int c,int d);
int a,b,c,d,max;
printf("Please enter 4 interger numbers:");
scanf("%d %d %d %d",&a,&b,&c,&d);
max=max4(a,b,c,d);
printf("max=%d\n",max);
return 0;
}
int max4(int a,int b,int c,int d)
{int max2(int a,int b);
int m;
m=max2(a,b);
m=max2(m,c);
m=max2(m,d);
return(m);
}
int max2(int a,int b)
{if(a>=b)
return a;
else
return b;
}

标签:return,函数,最大数,int,max,max4,max2,数中
From: https://www.cnblogs.com/xc0509/p/16901318.html

相关文章