题解 | #判断身材状态#
判断身材状态
https://www.nowcoder.com/practice/6f4afb0f8be64d5eaf65a205b8584888
#include <iostream> #include <vector> using namespace std; int main() { vector <double> m; vector <double> kg; // write your code here...... double tmp; cin>>tmp; kg.push_back(tmp); cin>>tmp; m.push_back (tmp); double BMI =kg[0]/(m[0]*m[0]); if(BMI<18.5) cout<<"偏瘦"; else if(BMI <20.9) cout<<"苗条"; else if(BMI<=24.9) cout<<"适中"; else cout<<"偏胖"; return 0; }