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

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

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

#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
提交
取消

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

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

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

幫助反饋 APP下載

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

公眾號

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