我的结果是77.68,大神看看···所以正确结果到底是?
#include <stdio.h>
double c;
double cost(int t ,double d)
{
double p;
if(23<=t<=24||0<=t<5)
{
p=2.3*1.2;
}
else
{
p=2.3;
}
if(d<=3)
{
c=13;
return c+1;
}
else
{
c=13+(d-3)*p;
return c+1;
}
}
int main()
{
double c=cost(9,12)+cost(18,12);
printf("小明每天打车的总费用为%f元",c);
return 0;
}