题解 | #计算体重指数#
计算体重指数
https://www.nowcoder.com/practice/422f6341cf1b4212a7f8c703df111389
#include <stdio.h> #include <math.h> int main() { int weight, height_cm; scanf("%d %d", &weight, &height_cm); float height_m = height_cm / 100.0; float bmi = weight / pow(height_m,2); printf("%.2f\n", bmi); return 0; }