大佬看看有什么需要完善的细节。
#include <stdio.h>
float taixCost(int shijian, int juli)
{
float money;
if (juli <= 3)
{
money = 13 + 1;
}
else
{
if (shijian >= 23 || shijian < 5)
{
money = 13 + 1 + 1.2*2.3*(juli - 3);
}
else
{
money = 13 + 1 + (juli - 3)*2.3;
}
}
return money;
}
int main()
{
float sum = taixCost(9, 12) + taixCost(18, 12);
printf("小明每天打车的总费用为%.2f元", sum);
return 0;
}