Java programming things 42-comprehensive process control exercises

Source: Internet
Author: User

Java programming those things 42-comprehensive process control exercises Zhengzhou game college Chen yuefeng from: http://blog.csdn.net/mailbomb 5.6.2 Comprehensive ExercisesThis part is a comprehensive exercise on the process control part, through which you can familiarize yourself with the basic syntax of the Java language and exercise the logic thinking ability. Exercise questions: 1. Calculate the minimum public multiples of numbers 12 and 18. 2. If there are 1 yuan/Apple, 2 yuan/orange, and 4 yuan/mango, how many combinations are there if there are 10 yuan to buy? 3. A monkey picked up a few peaches on the first day and immediately ate half of them. The monkey was not addicted, but ate another one. In the morning of the next day, he ate half of the remaining peaches, I ate another one. Later, I had to eat the remaining half of the previous day every morning. When I wanted to eat the remaining half of the previous day, I found that there was only one peach left. How many peaches have monkeys picked on the first day? 4. Calculate the factorial of 30. 5. A farm has a cow. Now the cow is only one year old. It is only four years old to have a calf. After four years old, a calf is born every year. Suppose every time a cow is born, and the rule that a 4-year-old cow has been born and has no mother died, how many cows are there after N years? 6. anggu conjecture: a middle school student in Japan discovered a wonderful "Theorem". Professor anggu was asked to prove it, and the professor was powerless, so he produced anggu conjecture. The content of the conjecture is: Give a natural number. If it is an even number divided by 2, if it is an odd number, multiply 3 and Add 1. Get a new natural number and continue the calculation according to the above rule, the result obtained after several times must be 1. Write code to verify that the conjecture is correct. 7. Output a series of 20 Rules: 1 1 2 3 5 8 13 ...... 8. Output 30 series of the following rules: 1 3 6 10 15 21 ...... 9. output the bitwise values of any one of the three digits and a hundred digits. For example, if the three digits are 235, the output is 532. 10. Calculate the sum of all prime numbers within 100. Here we only list some process control exercises. I hope you can actively add some typical process control exercises and improve them together.

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.