求助,请问,哪里有问题?
请问哪里有问题啊。。。?
#include <stdio.h>
void price(int iTime,int iDistance)
{
float fPricePerKm = 2.3;
float fTotalPrice;
if(iTime < 5 || iTime >=23)
{
fPricePerKm = fPricePerKm * 1.2;
}
if(iDistance<=3)
{
iDistance = 0;
}
else
{
iDistance -=3;
}
fTotalPrice = 13 + fPricePerKm * iDistance + 1;
printf("The total price is %.1f\n",fTotalPrice);
return fTotalPrice;
}
int main()
{
float fTotal;
float fEve = price(8,12);
float fMorn = price(22,12);
fTotal = fEve+fMorn;
printf("Total is %f\n",fTotal);
return 0;
}