交作業(yè)!?。?!
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[] xm = new string[8] { "景珍", "林惠洋", "成蓉", "洪南昌",
? ? ? ? ? ? "龍玉民", "單江開", "田武山","王三明" };
? ? ? ? ? ? int[] fs = new int[8] { 90, 65, 88, 70, 46, 81, 100, 68 };
? ? ? ? ? ? int max = 0;
? ? ? ? ? ? int pj = 0;
? ? ? ? ? ? for (int i = 0; i < fs.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? max += fs[i];
? ? ? ? ? ? }
? ? ? ? ? ? pj = max / fs.Length;
? ? ? ? ? ? Console.WriteLine("平均分?jǐn)?shù)是:" + pj );
? ? ? ? ? ? Console.WriteLine("高于平均分的有:");
? ? ? ? ? ? for (int x = 0; x < fs.Length; x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (pj < fs[x])
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine(xm[x]);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2022-03-31