課程
/后端開發
/C
/C語言入門
小李今年18歲,身高172厘米,體重82.5公斤,效力是否屬于肥胖呢?我們如何用程序描述?
2017-08-02
源自:C語言入門 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 }
舉報
C語言入門視頻教程,帶你進入編程世界的必修課-C語言
2 回答求答案
1 回答求答案~~
4 回答求答案
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
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