/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static double calcularIMC(double P,double A){
return P/(A*A);
}
public static void diagnostico(double imc){
if (imc < 16.0){
System.
out.
println("Baixo peso muito grave"); }
if (16< imc && imc <16.99){
System.
out.
println("Baixo peso grave"); }
if (17<imc && imc <18.49){
System.
out.
println("Baixo peso");
}
if (18.50< imc && imc < 24.99){
System.
out.
println("Peso norma"); }
if(25<imc && imc <29.99){
System.
out.
println("Sobrepeso"); }
if(30<imc && imc <34.99){
System.
out.
println("Obesidade grau I"); }
if(35<imc && imc <39.99){
System.
out.
println("Obesidade grau II"); }
if(imc>=40){
System.
out.
println("Obesidade grau II(obesidade morbida"); }
}
{
double A,P, imc;
Scanner entrada
=new Scanner
(System.
in);
System.
out.
println("Entre com o valor de sua altura em metros :"); A = entrada.nextDouble();
System.
out.
println("Entre com o valor de seu peso em Kg"); P = entrada.nextDouble();
imc = calcularIMC(P,A);
diagnostico(imc);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCQkKCXB1YmxpYyBzdGF0aWMgZG91YmxlIGNhbGN1bGFySU1DKGRvdWJsZSBQLGRvdWJsZSBBKXsKCQkJcmV0dXJuIFAvKEEqQSk7Cgl9CgkKCXB1YmxpYyBzdGF0aWMgdm9pZCBkaWFnbm9zdGljbyhkb3VibGUgaW1jKXsKCQkJCgkJCWlmIChpbWMgPCAxNi4wKXsKCQkJCVN5c3RlbS5vdXQucHJpbnRsbigiQmFpeG8gcGVzb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