最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機立即綁定

請各位朋友們看看我這個問題出在哪里啊?

#include <stdio.h>

int main()

{

? ? float? taxicost(int Time,int distance);

? ? int a;

? ? printf("please enter Time and distance")

? ? scanf("%d,%d",&Time,&distance);

? ? a=taxicost(Time,distance);

? ? printf ("小明每天打車的總費用是%f元",2*a);

? ? return 0;

}

float? taxicost(int Time,int distance)

{

? ??

if (distance<=3)

{

? ? taxicost=14;

}

else if(5<=Time<23;distance>3)

{

? ? taxicost=(distance-3)*2.3+14;

}

else if(23<=Time<24||24<=Time<5;distance>3)

{

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

}

return taxicost;

}


正在回答

1 回答

被調(diào)用函數(shù)要在主函數(shù)前面

主函數(shù)里面的? ?float? taxicost(int Time,int distance);? ? 可以省略啊

主函數(shù)的Time 和 distence 沒有聲明

變量a的類型應該是float類型

scanf("%d,%d",&Time,&distance); 用得不對啊,建議定義變量的時候直接賦值

taxicost函數(shù)里面的taxicost為變量需要聲明

else if(5<=Time<23;distance>3) 中 “;”改成“&&”

else if(23<=Time<24||24<=Time<5;distance>3)? ? 同上

24<=Time<5 Time是定義的變量不會遵循時間的24小時循環(huán) 改成“Time>0&&(Time<5||Time>=23)”

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

請各位朋友們看看我這個問題出在哪里啊?

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號