慕先生2341358
2019-11-03 22:58
#include <stdio.h>
float qian(int shijian,int gongli)
{ float qian;
if(shijian>=23||shijian<5)
{
if(gongli<=3)
{
qian == 14;
return qian;
}
else
{
qian == 14+(2.76*(gongli-3));
return qian;
}
}
else
{
if(gongli<=3)
{
qian == 14;
return qian;
}
else
{
qian == 14+(2.3*(gongli-3));
return qian;
}
}
}
int main()
{
float sum=qian(6,12)+qian(18,12);
printf("每天打车的总费用%f\n",sum);
return 0;
}
qian == 14;
qian对应的是赋值,应该用“=”;“==”是判断
C语言入门
926021 学习 · 20793 问题
相似问题