Java Fundamentals (sixth post-course assignments) 04

Source: Internet
Author: User

1  PackageCom.xunhuan;2 3  Public classZuoYe004 {4 5      Public Static voidMain (string[] args) {6         intMen ;7         intwomen;8         intKids;9         //The number of men is less or equal to 10, on this basis the self-addedTen          for(men=0;men<=10;men++){ One              for(women=0;women<=30;women++) {//women are equal to 30 people. A                 if(30-men-women >= 0) {//If you use 30 total-men-the number of women results is greater than or equal to 0, the number of children -                     intCount = 3*men + 2*women + (30-men-women);//to find out the total cost of money -                     if(count = = 50) {//if the total amount of money is equal to 50, enter the if theKids= (30-men-women);//total number of children -System.out.println ("man:" + Men + "woman:" +women+ "Child:" +kids); -                     } -                 } +             } -         } +              A         } at}

Java Fundamentals (sixth post-course assignments) 04

Related Article

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.