輸入 n 名學生成績,輸出 ≥平均分與 <平均分的人數。
using System;
using System.Collections.Generic;
using System.Linq;
class Program {
static void Main() {
int n = int.Parse(Console.ReadLine());
var scores = new List();
for (int i = 0; i < n; i++)
scores.Add(float.Parse(Console.ReadLine()));
float avg = scores.Average();
Console.WriteLine($"≥平均分: {scores.Count(s => s >= avg)}");
Console.WriteLine($"<平均分: {scores.Count(s => s < avg)}");
}
}