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

Problem 25: Minimum and Maximum

An integer N is given on the first line, and N integers separated by half-width spaces are given on the second line. Print the minimum and maximum values among them, in this order, separated by a half-width space, on one line.

Constraints

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

Input example 1

5
3 1 4 1 5

Output example 1

1 5

Input example 2

3
10 2 7

Output example 2

2 10

What you'll train

Specify the output

What you get

  • Specify the output order
  • Specify the delimiter character
  • Write the format for combining into one line

How to ask the AI

Tell the AI specifically that the output format should be "minimum, then maximum" on one line separated by a half-width space. The key point is to make it explicit so the order isn't reversed or split across separate lines.

If you ask vaguelyIf you don't specify the output order, the AI may print the maximum value first or separate the values with line breaks.

あなたのコード

実行しました

プレビュー

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

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

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