题解 | #计算体重指数#
计算体重指数
https://www.nowcoder.com/practice/422f6341cf1b4212a7f8c703df111389
#include <stdio.h>
//计算体重指数:公式:BMI=体重÷身高^2 ,公式中身高的单位是m
int main()
{
int height = 0;
int weight = 0;
scanf("%d %d",&weight,&height);
float a = (float)height/100;
a *= a;
float bmi = (weight/a);
printf("%.2f",bmi);
return 0;
}
