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

Problem 57: Number of People At or Above Average

An integer N is given on the first line, and the scores of N people are given on the second line, separated by spaces. Output the number of people who scored at or above the average on one line.

Constraints

1 ≤ N ≤ 100, 0 ≤ each score ≤ 100

Input example 1

5
10 20 30 40 50

Output example 1

3

Input example 2

4
80 80 80 80

Output example 2

4

What you'll train

State the constraints

What you get

  • Clarify the "at or above" condition
  • Instruct on the two-step process
  • Show how the average is computed

How to ask the AI

Clearly tell the AI that people whose score is "exactly equal" to the average should also be counted, i.e., counted as "at or above." It also helps to mention how the average should be calculated.

If you ask vaguelyOnly counting people whose score is greater than the average, forgetting to include those equal to the average.

あなたのコード

実行しました

プレビュー

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

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

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