问答详情
源自:5-14 综合练习

为啥输出是0啊,请大佬把我看看啊

#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;

}


提问者:慕先生2341358 2019-11-03 22:58

个回答

  • 慕瓜6016659
    2019-11-04 11:49:39
    已采纳

    qian == 14;

    qian对应的是赋值,应该用“=”;“==”是判断