编写函数fun,其功能是:求出形参x,y,z中的最大值,并将求出的结果返回给主函数
可以用函数返回值进行返回,也可以参数返回
int fun(int x,int y,int z)
{
if(x >= y)
{
if(x > z)
return x;
if(y > z)
return y;
return z;
}
else if(y > z)
{
return y;
}
return z;
}
int fun(int x, int y, int z)
{
int temp = 0;
if (x > y)
temp = x;
else
temp = y;
if (temp < z)
temp = z;
return temp;
}