码迷,mamicode.com
首页 > 编程语言 > 详细

C语言写bmi计算器

时间:2019-08-06 23:57:00      阅读:979      评论:0      收藏:0      [点我收藏+]

标签:bim   clu   计算器   scanf   inpu   turn   can   float   c语言   

#include<stdio.h>
int main() {
float BMI;
float weight;
float height;
float bmi;
printf("pleaae input the weight:");
scanf("%f", &weight);
printf("please input the height:");
scanf("%f", &height);
bmi= weight / (height * height);
printf("your BIM is %f",bmi);
if(bmi<18.5)printf("偏轻");
if(bmi>18.5&&bmi<24.9)printf("正常") ;
if(bmi>25&&bmi<29.9)printf("偏重") ;
if(bmi>30)printf("超重") ;
return 0;
}

C语言写bmi计算器

标签:bim   clu   计算器   scanf   inpu   turn   can   float   c语言   

原文地址:https://www.cnblogs.com/1728067596wc/p/11312632.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!