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

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

哪兒錯(cuò)了?

#include <stdio.h>
double getPrice (int hours,double distances)
{
??? double getPrice=0;
??? double distances=0;
??? int startPrice=13;
??? double perPrice=2.3;
??? if(hours<0 || hours>24)
??? {
??????? printf("請輸入正確時(shí)間\n");
??? }
??? if(hours<5 && hours>=23)
??? {
??????? perPrice*=1.2;
??? }
??? if(distances>3)
??? {
??????? getPrice=startPrice+perPrice*(distances-3);
??? }
??? else if
??? {
??????? getPrice=startPrice;
??? }
??? getPrice+=1;
??? return totalPrice;
}
int main()
{
??? int totalPrice;
??? double getPriceMoring=getPrice(9,12);
??? double getPriceEvening=getPrice(18,12);
??? double totalPrice=getPriceMoring+getPriceEvening;
??? printf("小明每天打車的總費(fèi)用為%f\n",totalPrice);
?? return 0;
}

正在回答

2 回答

#include <stdio.h>

double getPrice (int hours,double distances)

{

? ? double getPrice=0;

? ? double distancess=0;

? ? int startPrice=13;

? ? double perPrice=2.3;

? ? if(hours<0 || hours>24)

? ? {

? ? ? ? printf("請輸入正確時(shí)間\n");

? ? ? ? return 0;

? ? }

? ? if(hours<5 && hours>=23)

? ? {

? ? ? ? perPrice*=1.2;

? ? }

? ? if(distances>3)

? ? {

? ? ? ? getPrice=startPrice+perPrice*(distances-3);

? ? }

? ? else?

? ? {

? ? ? ? getPrice=startPrice;

? ? }

? ? getPrice+=1;

? ? return getPrice;

}

int main()http://idcbgp.cn/code/5642#editor-tabs-c

{

? ? //int totalPrice;

? ? double getPriceMoring=getPrice(9,12);

? ? double getPriceEvening=getPrice(18,12);

? ? double totalPrice=getPriceMoring+getPriceEvening;

? ? printf("小明每天打車的總費(fèi)用為%g\n",totalPrice);

? ?return 0;

}


0 回復(fù) 有任何疑惑可以回復(fù)我~
hello.c:?In?function?'getPrice':
hello.c:5:12:?error:?'distances'?redeclared?as?different?kind?of?symbol
?????double?distances=0;
????????????^~~~~~~~~
hello.c:2:35:?note:?previous?definition?of?'distances'?was?here
?double?getPrice?(int?hours,double?distances)
???????????????????????????????????^~~~~~~~~
hello.c:21:5:?error:?expected?'('?before?'{'?token
?????{
?????^
hello.c:25:12:?error:?'totalPrice'?undeclared?(first?use?in?this?function)
?????return?totalPrice;
????????????^~~~~~~~~~
hello.c:25:12:?note:?each?undeclared?identifier?is?reported?only?once?for?each?function?it?appears?in
hello.c:?In?function?'main':
hello.c:32:12:?error:?conflicting?types?for?'totalPrice'
?????double?totalPrice=getPriceMoring+getPriceEvening;
????????????^~~~~~~~~~
hello.c:29:9:?note:?previous?declaration?of?'totalPrice'?was?here
?????int?totalPrice;
?????????^~~~~~~~~~


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

舉報(bào)

0/150
提交
取消
C語言入門
  • 參與學(xué)習(xí)       926979    人
  • 解答問題       21533    個(gè)

C語言入門視頻教程,帶你進(jìn)入編程世界的必修課-C語言

進(jìn)入課程

哪兒錯(cuò)了?

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

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

幫助反饋 APP下載

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

公眾號

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