Job 4. Weigh

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.