#P5711. 【深基3.例3】闰年判断

【深基3.例3】闰年判断

Leap Year

Problem Source

Luogu P5711

Problem Description

Input a year and determine whether it is a leap year. If it is, output 11; otherwise output 00.

Definition of a leap year since 15821582:

  • Common leap year: a Gregorian year that is a multiple of 44 but not a multiple of 100100 is a leap year (e.g. 20042004 and 20202020 are leap years).
  • Century leap year: a Gregorian year that is a multiple of 100100 must be a multiple of 400400 to be a leap year (e.g. 19001900 is not a leap year, while 20002000 is a leap year).

Input Format

One positive integer nn, representing the year.

Output Format

One line. If the input year is a leap year, output 11; otherwise output 00.

Sample Input 1

1926

Sample Output 1

0

Sample Input 2

1900

Sample Output 2

0

Sample Input 3

2000

Sample Output 3

1

Sample Input 4

1996

Sample Output 4

1

Hint

  • The leap-year rule is two sentences; write the two conditions down on paper first, then combine them into one with logical operators.
  • Each side of || is a complete condition — do not omit the parentheses, since getting the precedence wrong gives the wrong answer.
  • Verify with the samples: 1900 → 0, 2000 → 1.

The data guarantees 1582≤n≤20201582 \le n \le 2020 and that the year is a natural number.