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

Problem 35: Sort in Ascending Order

An integer N is given on the first line, and N integers separated by single spaces are given on the second line. Sort them in ascending order and output them on one line, separated by single spaces.

Even if the same value appears multiple times, output all of them as they are.

Constraints

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

Input example 1

5
3 1 4 1 5

Output example 1

1 1 3 4 5

Input example 2

3
10 2 7

Output example 2

2 7 10

What you'll train

Specify the output

What you get

  • Specify the output separator
  • Indicate how to handle duplicate elements
  • Indicate whether a newline is needed

How to ask the AI

Tell the AI specifically that the output should be a single line with values separated by single spaces. It's also reassuring to remember to mention that if the same value appears multiple times, all of them must be output as they are.

If you ask vaguelyIf you don't specify the output format, the AI may produce comma-separated values or output one element per line instead.

あなたのコード

実行しました

プレビュー

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

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

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