#include <iostream> #include <cmath> //pow函数 using namespace std; int main() { double weight; double height; cin >> weight; cin >> height; // 计算体重指数BMI,返回身材状态 double BMI = 0.0; BMI = weight/pow(height,2); //二次幂函数 if( BMI < 18.5) cout << "偏瘦"; else if(BMI < 20.9) cout << "苗条"; else if(BMI < 24.9) cout << "适中"; else cout << "偏胖"; return 0; }