課程
/后端開(kāi)發(fā)
/C
/C語(yǔ)言入門(mén)
小李今年18歲,身高172厘米,體重82.5公斤,效力是否屬于肥胖呢?我們?nèi)绾斡贸绦蛎枋觯?/p>
2017-08-02
源自:C語(yǔ)言入門(mén) 3-3
正在回答
#include<stdio.h>
void main()
{
int year=18;
double height=1.72;
double weight=82.5;
double BMI;
BMI=weight/(height*height);
if(BMI<18)
printf("偏瘦\n");
}
else if(BMI>18&&BMI<25)
printf("正常體重\n");
else
printf("偏重\n");
#include<stdio.h> int?main() { int?age=18; int?height=172; double?weight=82.5; char?isfat='y'; printf(“”姓名:小李\n”); printf(“年齡:%d\n”,age); printf(“身高:%d\n”,height); printf(“體重:f\n”,weight); printf(“是否屬于肥胖兒童:%c\n”,isfat); return?0 }
舉報(bào)
C語(yǔ)言入門(mén)視頻教程,帶你進(jìn)入編程世界的必修課-C語(yǔ)言
2 回答求答案
1 回答求答案~~
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-08-02
#include<stdio.h>
void main()
{
int year=18;
double height=1.72;
double weight=82.5;
double BMI;
BMI=weight/(height*height);
if(BMI<18)
{
printf("偏瘦\n");
}
else if(BMI>18&&BMI<25)
{
printf("正常體重\n");
}
else
{
printf("偏重\n");
}
}
2017-08-02