namespace ConsoleApplication10 { class Program { static void Main(string[] args) { double[] a = new double[10];新建一个10个数的1维数组 double sum = 0; for (int i = 0; i < a.Length; i++) { a[i] = Convert.ToInt32(Console.ReadLine());//for循环建立一个数组有a.Length个数 sum=sum+a[i]; Console.WriteLine("第"+(i+1)+"个评委的分数为"+a[i]); } Console.WriteLine("总分为"+sum); double temp; for (int i = 0; i <a.Length; i++)//快速排序 { for (int j = i; j <a.Length-1; j++) { if (a[i]<a[j+1]) { temp = a[i]; a[i] = a[j + 1]; a[j + 1] = temp; } } } for (int i = 0; i < a.Length; i++) { Console.WriteLine(a[i]);一次输出排完序的数组 } Console.WriteLine("最高分" + a[0]); Console.WriteLine("最低分" + a[9]); double pj = (sum - a[0] - a[9])/(a.Length-2); Console.WriteLine("去掉一个最高分和最低分之后的平均最后得分为" + pj); Console.ReadLine(); } } }