#include <stdio.h>
float taxifee(int clock, int mile)
{
float money;
if(mile<=3)
{
money=14;
printf("打车费用为%f元\n", money);
}
else
{
if(clock<=5 || clock>=23)
{
money=(mile-3)*2.3*1.2 + 14;
printf("夜间费用为%f元\n", money);
}
else
{
money=(mile-3)*2.3+14;
printf("日间费用为%f元\n", money);
}
}
}
int main()
{
float finalfee;
finalfee=taxifee(9,12)+taxifee(18,12);
printf("实际打车费用为%f元\n", finalfee);
return 0;
}