The standard weight of a man is: weight (kg) = height (cm)-100.
The woman's standard weight is: weight (kg) = height (cm)-110.
Float up and down 3 kg is normal
Required input gender, height and weight, output normal, overweight, thin
1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 6 namespaceConsoleApplication17 {8 classWeight9 {Ten Static voidMain (string[] agre) One { AConsole.Write ("Please enter your gender (male, female):"); - stringSex =console.readline (); -Console.Write ("Please enter your height (cm):"); the stringh =console.readline (); - intHigh =Convert.ToInt32 (h); -Console.Write ("Please enter your weight (KG):"); - stringm =console.readline (); + intt =Convert.ToInt32 (m); - + if(Sex = ="male") A { at if(T > High- -+3) - { -Console.WriteLine ("your weight is too fat. "); - } - Else if(T < high- --3) - { inConsole.WriteLine ("your weight is thin. "); - } to Else if(T >=high- --3&& t<= High- -+3) + { -Console.WriteLine ("your weight is normal."); the } * } $ Else if(Sex = ="female")Panax Notoginseng { - if(T > High- the+3) the { +Console.WriteLine ("your weight is too fat. "); A } the Else if(T < high- the-3) + { -Console.WriteLine ("your weight is thin. "); $ } $ Else - { -Console.WriteLine ("your weight is normal."); the } - }Wuyi Else the { -Console.WriteLine ("the input is not correct, please verify. "); Wu } - } About } $}
Job 4. Weigh