可以运行但是结果错误- -,求大神帮忙看一下
#include <stdio.h>
int cost(int distances, int times)
{
double money;
if (distances <= 3){
return 14;
}
else if (times<5 || times >= 23){
money = 1.2*(distances - 3)*2.3 + 14;
}
else{
money = (distances - 3)*2.3 + 14;
}
return money;
}
int main()
{
printf("打车总费用:%.1f", cost(12, 9) + cost(12, 18));
system("pause");
}