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

Problem 47: Sorting in Descending 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 descending order (largest first) and output them on one line separated by single spaces.

Constraints

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

Input example 1

4
3 1 4 1

Output example 1

4 3 1 1

Input example 2

3
5 5 5

Output example 2

5 5 5

What you'll train

Specify the output

What you get

  • Specify the sort direction
  • Specify the output format
  • Express handling of equal values

How to ask the AI

Clearly tell the AI that the sort should be descending (largest first) rather than ascending. Don't forget to also mention that the output should be separated by single spaces.

If you ask vaguelyIf the direction isn't specified, the AI may just output the default ascending sort as is.

あなたのコード

実行しました

プレビュー

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

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

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