还是不能得到正确结果。代码中有哪些问题呢?请指正。
#include <stdio.h>
float cost(int x,int y)
{
float money;
float price=2.3;
if(x>=23||x>=0&&x<5)
{
price*=1.2;
}
else
{
goto LOOP;
}
LOOP:if(y<=3)
{
money=13+1;
}
else
{
money=13+(y-3)*price+1;
}
return money;
}
int main()
{
int x=9;
int y=12;
float money;
cost(x,y);
float cost1=money;
x=18;
y=12;
cost(x,y);
float cost2=money;
float totalcost=cost1+cost2;
printf("小明每天打车的总费用是%.2f\n",totalcost);
return 0;
}