Determine whether a certain year is a leap year---Program flow chart and box diagram

Determine whether a certain year is a leap year. Program flow chart and box plot:

1. Not a hundred years: A leap year is one that is divisible by 4 but not divisible by 100. (For example, 2016 is a leap year, and 2100 is not a leap year)

2. A hundred years: Leap years are divisible by 400 but not divisible by 3200. (For example, the year 2000 is a leap year, and the year 3200 is not a leap year)

3. For years with very large values: If this year is divisible by 3200 and 172800, it is a leap year. For example, the year 172,800 is a leap year, and the year 86,400 is not a leap year.

The above rules are more complicated. The simple rule we usually need to remember is: years that are evenly divisible by 4 but not 100, and years that are evenly divisible by 400 are leap years. After all, we won’t live until 3200 years. That is to say, we often say that there is a leap every four years, there is no leap every hundred years, and there will be another leap every four hundred years.

The flow chart is as follows:

img

The box diagram is as follows:

img

Guess you like

Origin blog.csdn.net/m0_63451989/article/details/131166984