課程
/后端開發(fā)
/C
/C語言入門
自定義是可以隨便定義一個(gè)函數(shù)嗎?
2017-10-26
源自:C語言入門 5-2
正在回答
#include <stdio.h>
float cost(input weight,input price)
{scanf("%f,%f\n",&weight,&price);
float money;
money=weight*price;
printf("總價(jià)為:%.1f\n",money);
return money;
}
int main(void)
{printf("總價(jià)格為:%.1f\n",cost(10,20);
return 0;}
qq_橙子味的琪_0 提問者
舉報(bào)
C語言入門視頻教程,帶你進(jìn)入編程世界的必修課-C語言
4 回答自定義函數(shù)
2 回答自定義函數(shù)
1 回答自定義函數(shù)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2017-10-26
#include <stdio.h>
float cost(input weight,input price)
{scanf("%f,%f\n",&weight,&price);
float money;
money=weight*price;
printf("總價(jià)為:%.1f\n",money);
return money;
}
int main(void)
{printf("總價(jià)格為:%.1f\n",cost(10,20);
return 0;}