The Loop statement for C #

Source: Internet
Author: User

1. Enter the month, the date number, and the output is the day ordinal of the year.

Loop statement:

For

Format

for (initial condition; cyclic condition; state change)

{

Loop body, execute code (break; jump out of loop body)

}

2. A game, the first 20 off is each of its own scores,

21-30 each pass is 10 points,
31-40 off, 20 points per pass
41-49 off, 30 points per pass
50 off, it is 100 points.

Use the If nested for method:

How to nest if:

3.

Find out the number of 7-related numbers within 100
1. Single-digit number is 7
2.10-digit number is 7
Multiples of 3.7

4.100 staircase, 0-49 knots is equal to the number of knots, 50 (including 50) per section 10 points, the score is entered.

The Loop statement for C #

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.