An integer N is given on a single line from standard input. For each integer from 1 to N, output one per line according to the following rules.
・If divisible by both 3 and 5: FizzBuzz
・If divisible by 3: Fizz
・If divisible by 5: Buzz
・Otherwise, the number itself
Constraints
1 ≤ N ≤ 100
Input example 1
5Output example 1
1
2
Fizz
4
BuzzInput example 2
3Output example 2
1
2
FizzWhat you'll train
State the constraints
What you get
How to ask the AI
Tell the AI that when a number is divisible by both 3 and 5, FizzBuzz should take priority—in other words, that the order in which conditions are checked matters. It's also reassuring to confirm that even a small value like N=1 produces the correct single-line output.
If you ask vaguelyIf you don't specify the order of the checks, the AI may process the multiple-of-3 condition first, resulting in code that never outputs FizzBuzz.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。