为什么我的得出的结果是28?
#include<stdio.h>
float cost(float t)
{
float number;
float n = 12;
if (0<n<= 3)
{
return 14;
}
else if ((n>3)&&(5 <= t<23))
{
number = (13 + (n - 3)*2.3) + 1;
return number;
}
else
{
number = (13 + (n - 3)*2.3*1.2) + 1;
return number;
}
}
int main()
{
float t;
printf("本次打车费用为%.2f\n", cost(6)+cost(21));
getchar();
return 0;
}