题解 | #衡量人体胖瘦程度#
衡量人体胖瘦程度
http://www.nowcoder.com/practice/4d604603fae94a26b59b7bc18f363bc0
#include<stdio.h> int main() { int a,b; float c,bmi; while(scanf("%d %d",&a,&b)!=EOF) { c= b/100.0; bmi = a/(c*c); if(bmi<18.5) printf("Underweight\n"); else if(bmi>=18.5&&bmi<=23.9) printf("Normal\n"); else if(bmi>23.9&&bmi<=27.9) printf("Overweight\n"); else printf("Obese\n"); } return 0; }