Untitled

heh
 avatar
user_0563559
c_cpp
6 months ago
921 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
    setlocale(LC_ALL, "Russian");
    float weight, height, bmi;
    char pol;

    cout << "вес: ";
    cin >> weight;
    cout << "рост: ";
    cin >> height;
    cout << "пол (мужской,женский): ";
    cin >> pol;

    bmi = weight / (height * height);

    cout << "Ваш ИМТ: " << bmi << endl;
    if (pol == 'ж' || pol == 'Ж') {
        if (bmi >= 20 && bmi <= 24) {
            cout << "нормальный вес." << endl;
        }
        else {
            cout << "ненормальный вес." << endl;
        }
    }
    else if (pol == 'м' || pol == 'М') {
        if (bmi >= 18 && bmi <= 23) {
            cout << "нормальный вес." << endl;
        }
        else {
            cout << "ненормальный вес." << endl;
        }
    }

    return 0;
}