Написать программу, которая запрашивает реальный рост и вес пользователя, вычисляет его оптимальный вес, сравнивает его с реальным и выдает рекомендацию о необходимости поправиться или похудеть. Pascal ABC
begin write('Enter your height (in meters): '); readln(height);
write('Enter your weight (in kilograms): '); readln(weight);
optimalWeight := 22 * sqr(height);
writeln('Your optimal weight is ', optimalWeight:0:2, ' kg.');
if weight > optimalWeight then writeln('You need to lose weight.') else if weight < optimalWeight then writeln('You need to gain weight.') else writeln('Your weight is ideal.'); end.
program OptimalWeight;
var
height, weight, optimalWeight: real;
begin
write('Enter your height (in meters): ');
readln(height);
write('Enter your weight (in kilograms): ');
readln(weight);
optimalWeight := 22 * sqr(height);
writeln('Your optimal weight is ', optimalWeight:0:2, ' kg.');
if weight > optimalWeight then
writeln('You need to lose weight.')
else if weight < optimalWeight then
writeln('You need to gain weight.')
else
writeln('Your weight is ideal.');
end.