第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

請(qǐng)各位朋友們看看我這個(gè)問(wèn)題出在哪里???

#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èi)用是%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 沒(méi)有聲明

變量a的類型應(yīng)該是float類型

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

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

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

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

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

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

請(qǐng)各位朋友們看看我這個(gè)問(wèn)題出在哪里?。?/h1> 我要回答 關(guān)注問(wèn)題

微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)