#include<stdio.h>
int main()
{
int max4(int ,int ,int,int);
int a,b,c,d,max;
printf("Please enter 4 numbers in it");
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,max2(b,max2(c,d)));
return m;
}
int max2(int a,int b)
{
if(a>=b)
return a;
else
return b;
}
调用函数:4个数字中求最大数
最新推荐文章于 2023-11-23 10:26:21 发布