/*
输入a,b,c
求三个整数中的较大者
*/
#include <stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
d=max(a,b,c);
printf("the max number is %d.\n",d);
return 0;
}
int max(int x,int y,int z)
{
if(x<y)
if(y<z)
return z;
else
return y;
else
return x;
}
输入:
3 5 7
输出结果:
the max number is 7.