윤년

윤년

주어진 연도가 윤년인지 판별해요.
윤년 깊이 파고들기!

윤년을 푸는 데 사용할 수 있는 다양한 알고리즘과 접근법을 깊이 파헤쳐 봐요. Jeremy와 Erik이 Exercism에서 10가지 언어에 걸친 흥미로운 커뮤니티 풀이를 살펴봐요.

지시 사항

A leap year (in the Gregorian calendar) occurs:

  • In every year that is evenly divisible by 4.
  • Unless the year is evenly divisible by 100, in which case it's only a leap year if the year is also evenly divisible by 400.

Some examples:

  • 1997 was not a leap year as it's not divisible by 4.
  • 1900 was not a leap year as it's not divisible by 400.
  • 2000 was a leap year!
Note

For a delightful, four-minute explanation of the whole phenomenon of leap years, check out this YouTube video.

Your task is to determine whether a given year is a leap year.