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

算出结果是69.400002??

算出结果是69.400002??

提问者:慕雪5600824 2017-11-29 22:35

个回答

  • 慕标5152115
    2018-03-06 16:24:12

    对,算出结果是69.400002,输出的时候你可以用%.1f只保留一位小数

  • Ben_bios
    2017-12-29 14:13:45

    #include <stdio.h>

    float num;

    float pay(int x, int y)//x为公里数,y为时间

    {   

        

        if(y<=23&&y>5)

        {

            if(x<=3){

                return 14;

            }

            else

            {

                num=13+2.3*(x-3)+1;

                

                return num;

            }

        }

        else

        {

            if(x<=3){

                return 13;

            }

            else

            {

                num=13+2.3*1.2*(x-3)+1;

                return num;

            }

        }

    }

    int main()

    {

       num=pay(12,9)*2;

        printf("小明每天的打车费用%f\n",num);

        

    }

    仅供参考

  • 慕粉5327318
    2017-11-29 23:39:45

    不是    是35.7

    #include <stdio.h>
    int main()
    {
        //int 12;
        //float sm=0;
        printf("%f",9*2.3+13+2);
        return 0;
    }