An integer N is given on the first line, and N integers separated by single spaces are given on the second line. Sum up only the odd numbers among them and output the result on one line. If there are no odd numbers at all, output 0.
Constraints
1 ≤ N ≤ 100, 0 ≤ each element ≤ 1000
Input example 1
5
1 2 3 4 5Output example 1
9Input example 2
3
2 4 6Output example 2
0What you'll train
Cover the edge cases
What you get
How to ask the AI
In addition to the process of summing only odd numbers, clearly tell the AI about the special case where 0 should be output if there are no odd numbers at all.
If you ask vaguelyFor input containing no odd numbers, the implementation may end up returning an empty string or an error instead of 0.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。