CodeDrill
day_streak: --
← 問題一覧に戻る
Python ・ Standard I/O

Problem 45: Checking Whether It's a Leap Year

An integer Y representing a year is given on one line. If it is a leap year, output Yes; if it is a common year, output No.

Leap year rule: a multiple of 4 is a leap year. However, a multiple of 100 is not a leap year. However, a multiple of 400 is a leap year.

Constraints

1 ≤ Y ≤ 3000

Input example 1

2024

Output example 1

Yes

Input example 2

1900

Output example 2

No

What you'll train

Cover the edge cases

What you get

  • Express exception conditions
  • Convey priority order
  • Express the judgment logic

How to ask the AI

Clearly convey to the AI the three-level rule of multiples of 4, 100, and 400, and their priority order (multiples of 400 take top priority). Giving a specific example like the year 2000 helps prevent misunderstanding.

If you ask vaguelyForgetting the exclusion condition for multiples of 100 and judging leap years based only on multiples of 4 leads to incorrect results for years like 2100.

あなたのコード

実行しました

プレビュー

AIレビュー(プロンプト練習)

コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。

先にコードを実行し、テストを1つ以上通してください。