Untitled
hehuser_0563559
c_cpp
2 years ago
921 B
6
Indexable
#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;
}Editor is loading...