题解 | #健康评估#

知识点:

分支控制:分支控制

#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;
}


#算法#
全部评论

相关推荐

积极的小学生不要香菜:你才沟通多少,没500不要说难
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务