12. Leap Year
Foundation1000 ms256 MBSolved by 0%
Read a year and print Yes if it is a leap year, or No if it is not.
A year is a leap year when it is divisible by 4, except that years divisible by 100 are not leap years, unless they are also divisible by 400.
So 1996 is a leap year, 1900 is not, and 2000 is.
Constraints - `1 ≤ year ≤ 10000`
Input
A single line containing one integer n.
Output
Print exactly one word: Yes or No.
Input1996
OutputYes
Noteis divisible by 4 and not by 100
Input1900
OutputNo
Noteis divisible by 100 but not by 400, the exception most solutions miss
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.