#include <iostream>
using namespace std;
class BMI {
    public:
    int cm;
    int kg;
    double a;

BMI(int c,int k){
    cm = c;
    kg = k;
}

    void calculate(){
        double m = cm / 100.0;
        double bmi = kg / (m * m);
        if (a < 18.5) {
            cout << "저체중" << endl;
        } else if (a < 23) {
            cout << "정상" << endl;
        } else if (a < 25) {
            cout << "과체중" << endl;
        } else {
            cout << "비만" << endl;
        }
    }
};
int main() {
BMI b(180,80);
    b.calculate();
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: