输入三个数,并找出最大的输出

来源:互联网 发布:嘉兴菜鸟网络食堂 编辑:程序博客网 时间:2024/05/01 08:53
 

#include<stdio.h>

int main()
{
 int max(int x,int y);
 int a,b,c,t;
 printf("Please input three numbers:\n");
 scanf("%d %d %d",&a,&b,&c);
 t=max(max(a,b),c);
 printf("the biggest number is %d\n",t);
}

int max(int x,int y)
{
 int z;
 if(x>y) z=x;
 else z=y;
 return(z);
}

 

别小看这个程序,这个多重的函数嵌套用法,可以扩展到456....甚至更多的数,找出最大的数。

原创粉丝点击