c不是vb,函数
返回值要用return,其他有几个小错误,帮你改好了
#include <stdio.h>
#include <stdlib.h>
double tmax(double a,double b,double c)
{
double max;
if (a>b)
{
if (a>c) return a;//max=a;
else return c;//max=c;
}
else
{
if (b>c) return b;//max=b;
else return c;//max=c;
}
}
int main()
{
double a,b,c;
scanf ("%lf%lf%lf",&a,&b,&c); // double输入用%lf
printf ("tmax=%f\n",tmax(a,b,c));
system ("pause");
return 0;
}
本回答被网友采纳