知识点:
分支控制:分支控制
#include <iostream>
#include <cmath>
using namespace std;
int main() {
float weight = 0.0;
float height = 0.0;
float BMI = 0.0;
string health = "Abnormal";
cin >> weight >> height;
BMI = weight / pow(height, 2);
if ((BMI >= 18.5) && (BMI <= 23.9)) {
health = "Normal";
}
cout << health;
return 0;
}



京公网安备 11010502036488号