大家帮忙看一下,我这算出来怎么是578.9996呢
#include <stdio.h>
void main()
{
float distence=12,timeA=9,timeB=18,fare=0,sum=0,n;
for(n=0;n<2;n++)
{ if (distence<=3)
fare=14;
else
if(timeA<=5||timeA>=23)
fare=(distence-3)*2.3*1.2+14;
else
fare=(distence-3)*2.3*+14;
sum+=fare;
timeA=timeB;
}
}
printf("小明每天的打车费用为%f",sum);
}