题解 | #衡量人体胖瘦程度#
衡量人体胖瘦程度
https://www.nowcoder.com/practice/4d604603fae94a26b59b7bc18f363bc0
#include <stdio.h> int main() { float a, b, BMI = 0.0; while (scanf("%f %f", &a, &b) != EOF) { BMI = a/(b*b/10000.0); if (BMI < 18.5) { printf("Underweight\n"); } else if (BMI < 23.9) { printf("Normal\n"); } else if (BMI < 27.9) { printf("Overweight\n"); } else { printf("Obese\n"); } } return 0; }
c语言刷题 文章被收录于专栏
c语言刷题题目