执行完是26,求大神帮看
#include <stdio.h>
float pay(int m,int t)
{
float fee =13;
if(m>=3)
{
if(t>=23||t<5)
{
fee+=2.76*(m-3);
}
}
else
{
if(m>=3)
{
fee+=2.3*(m-3);
}
}
return fee;
}
int main()
{
printf("小明明天打车的费用是%.1f\n",pay(12,9)+pay(12,18));
return 0;
}
#include <stdio.h>
float pay(int m,int t)
{
float fee =13;
if(m>=3)
{
if(t>=23||t<5)
{
fee+=2.76*(m-3);
}
}
else
{
if(m>=3)
{
fee+=2.3*(m-3);
}
}
return fee;
}
int main()
{
printf("小明明天打车的费用是%.1f\n",pay(12,9)+pay(12,18));
return 0;
}
2019-09-10
举报