Katius
СДЕЛАЙТЕ ТРАССИРОВОЧНУЮ ТАБЛИЦУ#include #include using namespace std; int ves, rost, vozrast, ideal, different, k; string pol, otvet; void Inform()//введение информации о себе { cout<<"vvedite svoi pol, man or woman"< >pol; cout<<"vvedite svoi rost"< >rost; cout<<"vvedite svoi vozrast"< >vozrast; } void Gender()//вычисление идеального веса { if (pol=="man") k=1; if (pol=="woman") k=2; switch (k) { case 1 : ideal=1. 15*(rost-110); if (vozrast<=16) ideal=ideal-5; if (vozrast>16 && vozrast<=25) ideal=ideal; if (vozrast>25 && vozrast<=45) ideal=ideal+5; if (vozrast>45) ideal=ideal-5; cout<<"vash idealni ves="< >otvet; break; case 2 : ideal=1. 15*(rost-120); if (vozrast<=16) ideal=ideal-5; if (vozrast>16 && vozrast<=25) ideal=ideal;if (vozrast>25 && vozrast<=45) ideal=ideal+5; if (vozrast>45) ideal=ideal-5; cout<<"vash idealni ves="< >otvet; break; default: cout<<"ne pravilniy pol"< >ves; if(ves>ideal) { different=ves-ideal; if (different>7) cout<<"vash ves previshaet normu chtoby vash ves soblyudal normu zanimaytes' sportom yesh'te frukty i ovoshchi"< 7) cout<<"vash ves nizhe normu chtoby vash soblyudal normu zanimaytes' sportom yesh'te frukty i ovoshchi"<else cout<<"Vash ves sobludaet normu"<} } int main() { Inform(); Gender(); if (otvet=="yes") { Different(); } return 0; }
ответы: 1
Зарегистрируйтесь, чтобы добавить ответ
Чтобы ответить необходимо зарегистрироваться.