#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
int n;
int x;
int count = 0;
srand(time(0));
n = rand()%10 + 1;
cout << "Igra 'ugadai chislo'" << endl
<< "Computer zadumal chislo ot 1 do 10" << endl
<< "Ugadaite ego za 5 popitok." << endl;
do
{
cout << "\nVvedite chislo i nashmite 'enter'\n\t-> ";
cin >> x;
if (x == n) cout << "Ura! Vi ugadali!";
count++;
} while (x!=n && count<5);
return 0;
}
Объяснение:
height = float(input('''Введите ваш рост в формате "1.85": '''))
weight = float(input("Введите ваш вес: "))
BMI = weight / (height**2)
if BMI <= 16:
print ("Выраженный дефицит массы телы")
elif BMI >= 16 and BMI <= 18.5:
print ("Дефицит массы тела")
elif BMI >= 18.5 and BMI <= 24.99:
print ("Норма")
elif BMI > 25 and BMI < 30:
print ("Избыточная масса тела")
elif BMI >30 and BMI < 35:
print ("Ожирение первой степени")
elif BMI >35 and BMI <40:
print ("Ожирение второй степени")
elif BMI >40:
print ("Ожирение третьей степени")
Объяснение: