An integer N is given on one line from standard input. Output, on one line, the sum of all integers from 1 to N inclusive that are multiples of 3 or 5.
For example, if N is 10, the qualifying numbers are 3, 5, 6, 9, 10, so the sum is 33.
Constraints
1 ≤ N ≤ 100000
Input example 1
10Output example 1
33Input example 2
3Output example 2
3What you'll train
State the constraints
What you get
How to ask the AI
Clearly tell the AI that the range from 1 to N should include N, and that for the condition "multiples of 3 or 5," numbers satisfying both should not be counted twice.
If you ask vaguelyNumbers that are multiples of both 3 and 5 (multiples of 15) might get added twice.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。