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

Problem 30: Reverse a Sequence

An integer N is given on the first line, and N integers separated by half-width spaces are given on the second line. Print them in reverse order, separated by half-width spaces, on one line.

For example, for 1 2 3 4 5, the answer is 5 4 3 2 1.

Constraints

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

Input example 1

5
1 2 3 4 5

Output example 1

5 4 3 2 1

Input example 2

3
10 20 30

Output example 2

30 20 10

What you'll train

Specify the input

What you get

  • Write how to receive the sequence
  • Write the role of the element count N
  • Specify the delimiter character

How to ask the AI

Tell the AI precisely about the input format: N on the first line represents the number of elements, and N integers separated by half-width spaces follow on the second line. It also helps to mention that the output should use the same delimiter format.

If you ask vaguelyIf the input format is left ambiguous, the AI may ignore N or arbitrarily switch the delimiter to a comma.

あなたのコード

実行しました

プレビュー

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

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

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