#include<stdio.h>
int max(int a,int b,int c)
{
int f;
if(a>b)
f=a;
else
f=b;
if(f<c)
f=c;
return f;
}
void main()
{
int a,b,c,f;
printf("请输入三个整数:\n");
scanf("%d%d%d",&a,&b,&c);
f=max(a,b,c);
printf("最大数为:%d\n",f);
}
编写一个函数,使其向主函数返回您输入的3个整数参数中的最大值,并在主函数中输出该值。
最新推荐文章于 2024-04-15 09:30:00 发布