为啥小数点后多了个1求大神指点
#include <stdio.h>
float money(int s,int h)
{
float cost;
if(s<=3)
{
cost=14;
}
else
{
if((h>=23)&&(h<=24)||(h<=5)&&(h>=0))
{
cost=14+(s-3)*2.3*1.2;
}
else
{
cost=14+(s-3)*2.3;
}
printf("小明打车花费:%f\n",cost);
return cost;
}
}
int main()
{
float num=money(12,9)+money(12,18);
printf("all the cost is:%f\n",num);
return 0;
}