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

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

這個代碼該怎么改???謝謝!


#include <stdio.h>


float cost(int time,int mile)

{

? ? float money;

? ? if(mile<=3)

? ? {

? ? ? ? money=14;

? ? ? ? printf("打車費用為14元");

? ? else

? ? {

? ? ? ? if(time>=23||time<5)

? ? ? ? {

? ? ? ? ? ? money=13+2.3*1.2*(mile-3)+1;

? ? ? ? ? ? printf("打車費用為%.1f元",money);

? ? ? ??

? ? ? ? }

? ??

? ? ? ? else

? ? ? ? {

? ? ? ? ? ? money=13+2.3*(mile-3)+1;

? ? ? ? ? ? printf("打車費用為%.1f元",money);

? ? ? ? }

? ? }

? ? return money;

}

int main()

{

? ? float totalMoney=cost(9,12)+total(6,12);

? ? printf("打車費用為%.1f元\n",totalMoney);

? ? return 0;

}


正在回答

2 回答

#include <stdio.h>

float cost(int time,int mile);//這里最好聲明一下

float cost(int time,int mile)

{

? ? float money;

? ? if(mile<=3)

? ? {

? ? ? ? money=14;

? ? ? ? printf("打車費用為14元");

//少了一個括號

}

? ? else

? ? {

? ? ? ? if(time>=23||time<5)

? ? ? ? {

? ? ? ? ? ? money=13+2.3*1.2*(mile-3)+1;

? ? ? ? ? ? printf("打車費用為%.1f元",money);//逗號要英文的

? ? ? ? }

? ? ? ? else

? ? ? ? {

? ? ? ? ? ? money=13+2.3*(mile-3)+1;

? ? ? ? ? ? printf("打車費用為%.1f元",money);

? ? ? ? }

? ? }

? ? return money;

}

int main()

{

? ? float totalMoney=cost(9,12)+cost(6,12);

//float totalMoney=cost(9,12)+total(6,12);total是????

? ? printf("打車費用為%.1f元\n",totalMoney);

? ? return 0;

}


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

whelf 提問者

謝謝!
2015-08-05 回復(fù) 有任何疑惑可以回復(fù)我~

#include <stdio.h>

?


float cost(int time,int mile)

{

??? float money;

??? if(mile<=3)

??? {

??????? money=14;

??????? printf("打車費用為14元");
??? }
??? else? if(time>=23||time<5)
??????? {
??????????? money=13+2.3*1.2*(mile-3)+1;

??????????? printf("打車費用為%.1f元\n",money);
??????? }
??????? else

??????? {

??????????? money=13+2.3*(mile-3)+1;

??????????? printf("打車費用為%.1f元\n",money);

??????? }

?

??? return money;

}

int main()

{

??? float totalMoney=cost(9,12)+cost(6,12);

??? printf("打車費用為%.1f元\n",totalMoney);

??? return 0;

}

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

whelf 提問者

謝謝!
2015-08-05 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

這個代碼該怎么改???謝謝!

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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