int main() {
double high,weight,index
while(scanf("%lf%lf",&high,&weight) == 2) {
index = weight / high / high
if(index < 18) printf("偏瘦体重\n")
else if(index < 25) printf("正常体重枣郑\n")
else if(index < 30) printf("微度肥胖\n")
else if(index < 35) printf("轻度肥胖\n")
else if(index < 40) printf("中度肥胖\n")
else printf("重度行烂肥胖\n")
printf("身档岩漏高 体重(q to quit):")
}
return 0
}
#include <stdio.h>#include <conio.h>
int main (void) { 培判
float h, w, bmi
printf ("身高(m):")
scanf ("%f", &锋孝h)
printf ("体重(kg):")
scanf ("%f", &w)
bmi = w/(h*h)
printf ("BMI:%f\n", bmi)
getch () /*屏幕暂留*/
return 0
}
运行结果银中稿
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)