答案都是69.400002吗?
#include <stdio.h>
float price;
float Price(int time, int distance)
{
if (distance <= 3){
price = 13;
}
else{
if (time >= 5 && time < 23){
price = 13 + (distance - 3)*2.3 + 1;
}
else{
price = 13 + (distance - 3)*2.3*1.2 + 1;
}
}
return price;
}
int main()
{
printf("小明每天打车的总费用为:%f\n", Price(9, 12) + Price(18, 12));
return 0;
}