60分,求助
查看原帖
60分,求助
1287379
Yun_an楼主2024/2/24 10:54

测试点1、2是错的 代码:

#include <iostream>
#include <cmath>
#include <math.h>
using namespace std;

int main(int argc, char** argv) {
    double weight;
    double height;
    cin >> weight >> height;
    double bmi = weight/(height*height);
    if(bmi < 18.5){
        cout << "Underweight"<< endl;
    }else if(bmi >= 24){
        cout << bmi << endl;
        cout << "Overwight"<< endl;
    }else{
        cout << "Normal"<< endl;
    };
    return 0;
}
2024/2/24 10:54
加载中...