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

救救孩子吧!太难了!

http://img2.mukewang.com/5e212c2900010a6e16001200.jpg啊啊啊啊啊啊

提问者:慕神9413668 2020-01-17 11:38

个回答

  • weixin_慕前端3443785
    2020-02-06 14:40:10

    #include <stdio.h>

    double payment(int distance,int time)

    {  double price;

        if(distance<=3)

           price=14;

        else if(time>=0&&time<5||time>=23&&time<=24)

           price=2.3*1.2*(distance-3)+14;

        else

            price=2.3*(distance-3)+14;

        return price;

    }


    int main()

    {

        int L,T;

        L=12;

        T>=9&&T<=18;

      double price=payment(L,T);

        printf("小明每天打车总费用是%0.2f",price);

        

        return 0;

    }

    //我这个可以运行

  • weixin_慕前端3443785
    2020-02-06 14:36:07

    #include <stdio.h>double payment(int distance,int time){  double price;    if(distance<=3)       price=14;    else if(time>=0&&time<5||time>=23&&time<=24)       price=2.3*1.2*(distance-3)+14;    else        price=2.3*(distance-3)+14;    return price;}int main(){    int L,T;    L=12;    T>=9&&T<=18;  double price=payment(L,T);    printf("小明每天打车总费用是%0.2f",price);        return 0;}


  • 天神墨迹
    2020-01-28 13:02:35

    最后输出的 printf("每天打车的总费用为%f",qian(12,9)+qian(12,6))中qian(12,6)应是qian(12.18)