C#5 Review summary of cyclic iterations and poor lifting

Source: Internet
Author: User

First, chapter review:

Cycle. A syntactic form that executes a sentence repeatedly.

1. Basic syntax:

for (initial condition; cyclic condition; change of State)

{

Loop body

}

The four elements of the loop.

The execution process of the loop. Initial conditions--cyclic condition--cyclic body--state change--Cyclic condition--。。。。。

Case: 1. Print 10 hello. 2. Displays 1-100 of the number (all, odd, even). 3. Display ASCII code.

2. Looping the nesting.

for (...; ... ; ...)

{

for (...; ...; ...)

{

}

}

Case: Print a variety of graphics--outer loops, print lines. Inner loop, print column.

3. Application (iteration, exhaustive)

Iteration: According to a certain rule, the pass cycle gradually deduces the final result. The result is not correct often is the method has the problem, the method is incorrect often is the thought has the question.

The most important thing is to find out the law of the iteration and express it in an expression.

Case:

1.100 or less of all numbers.

2. Factorial

3. Age deduction.

4. Origami. Put food on the board.

5. Monkeys eat peaches.

6. Drop the ball

7. Rabbits give birth to rabbits.

Exhaustive: take all possible situations and find the conditions that meet the requirements.

The most important thing is to see if it can be solved with a poor lift, and how to write out the poor grammar.

Case:

1.100 or less of 7.

2. Coin combination problem. The 1,2,5 combines 1 hairs of 5来.

3. Buy something. Toothbrush, body soap, shampoo.

4. Hundred Chicken Hundred Money, hundred Ma Baishi.

5. Scout

6. Equation Fill operator

C#5 Review summary of cyclic iterations and poor lifting

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.