#include <stdio.h>
float qian(int gongli,int shijian)
{
float qian;
if (shijian>=23||shijian<5)
{
if ( gongli<=3)
{
qian=14;
return qian;
}
else {
qian==(gongli-3)*2.3*1.2+1+13;
return qian;
}
else{
if(gongli<=3)
{
qian=14;
return qian;
}
else
{
qian==(gongli-3)*2.3+13+1;
return qian;
}
}
}
int main()
{
float sum=qian(12,9)+qian(12,18);
printf("小明每天打车的费用%f\n元" ,sum);
return 0;
}
else{
if(gongli<=3)
{
qian=14;
return qian;
}
else
{
qian==(gongli-3)*2.3+13+1;
return qian;
}
}
你的这一行前面少了个 } 不过你的答案有问题