#include <stdio.h>
float taxitee(int t,int d)
{
float money;
if(t>=5&&t<=23)
{
if(d<=3)
{
money=14;
printf("打车费用是%s元",money);
return 14;
}
else
{
taxitee=13+2.3*(d-3)+1;
printf("打车费用是%s元",money);
return money;
}
}
else if(t<=5&&t>=23)
{
if(d<=3)
{
money=14;
printf("打车费用是%s元",money);
return 14;
}
}
else
{
money=13+2.3*1.2*(d-3)+1;
printf("打车费用是%s元",money);
return money;
}
}
int main()
{
printf("小明每天打车总费用:%f",taxitee(9,12)+taxitee(18,12));
return 0;
}
onemoo
相关分类