C # Looping Statements Exercise 2

Source: Internet
Author: User

1. Badminton Racket 15 Yuan, the ball 3 yuan, the water 2 yuan, has 200 yuan, each kind at least buys one, asks has several buys the method?

2. Shampoo 15 Yuan, toothbrush 5 yuan, soap 2 yuan, has 150 yuan, each kind at least buys one, asks has several buys the method?

3. With 100 yuan to buy 100 chickens, Rooster 2 yuan, hen 1 yuan, chick 5 angle, there are several ways to buy?

4. The Camel 2 stone grain, 1 stone grain, two pony camel 1 stone grain, 100 horses, 100 stone grain, there are several camel law?

5. There are 1 cents, cent money, 5 cents coins, to combine 2 cents, there are several combinations of methods, respectively?

6. Five children lined up and asked how big the first one was, the first one said that it was two years older than the second, and the second was two years older than the third one.

And so on, asked the fifth child, said that he was three years old, asked the first child how old?

7. A game, the first 20 off is its own score;

21-30 per 10 points, 31-40 per 20 points, 41-49 per 30 points, 50 off 100. Use the While loop statement.

8. Find out 100 and 7 related to the number and print, single digit is 7 a%10=7, 10 digits is 7 a/10=7, can be divisible by 7 of the number a%7=0. You need to use the while loop statement.


C # Looping Statements Exercise 2

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.