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

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

人麻了,怎么讓返回值返回實型啊

#include <stdio.h>?

int getPrice(int distance,int time) {

float cost;

if (distance <= 3) {

cost = 14;

}

else

{

if (time >= 5 && time < 23) {

cost = (distance - 3) * 2.3 + 14;

}else {

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

}

}

return cost;

}

int main() {

int distance,time;

float cost;

distance = 12;

time = 9;

float cost1=getPrice(distance, time);

time = 18;

float cost2 = getPrice(distance, time);

cost = cost1 + cost2;

printf("小明每天要花%f元坐車", cost);

return 0;

}


正在回答

0 回答

舉報

0/150
提交
取消

人麻了,怎么讓返回值返回實型啊

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

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

幫助反饋 APP下載

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

公眾號

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