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

Problem 12: Sum of N Integers

You are given an integer N on the first line, and N integers separated by single spaces on the second line. Output the sum of all of them on one line.

Constraints

1 ≤ N ≤ 100, 0 ≤ each element ≤ 1000

Input example 1

3
1 2 3

Output example 1

6

Input example 2

5
10 20 30 40 50

Output example 2

150

What you'll train

Specify the input

What you get

  • Specify the number of input lines
  • State the delimiter explicitly
  • Explain how the count relates to the elements

How to ask the AI

Clearly convey the input format: N on the first line, followed by N space-separated integers on the second line. It's reassuring to also mention that when N=0, the second line may be empty.

If you ask vaguelyWhen N=0 and the second line is empty, the AI might cause an error while reading the input.

あなたのコード

実行しました

プレビュー

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

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

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