{
  Programa para o cálculo do índice de massa corporal.
  Implementação utilizando apenas if-then.
} 
program calc_imc;
var
   p, h, imc : real;

begin
   writeln;
   writeln('Cálculo do índice de massa corporal');
   writeln;
   write('Peso (kg): ');
   read(p);
   write('Altura (m): ');
   read(h);
   
   imc := p/(h*h);
   writeln;
   writeln ('IMC: ', imc:2:2);
   
   if (imc <= 19) then
      writeln('Abaixo do peso.');
   if (imc > 19) and (imc <= 25) then
      writeln('Peso normal.');
   if (imc > 25) and (imc <= 30) then
      writeln('Sobrepeso.');
   if (imc > 30) then
      writeln('Obeso.');
end.

