static void Main (string[] args)
{
ArrayList al = new ArrayList (); Define a collection
Console.Write ("Please enter the number of people:");
int n = Convert.ToInt32 (Console. ReadLine ());
for (int i = 0; i < n; i++)
{Console.Write ("Please enter" + (i+1) + "Student's score:");
Al. ADD (Convert. ToInt32 (Console. ReadLine ())); Store data type and convert to int type
}
Al. Sort (); Sort ArrayList or some of his elements ascending here from small to large
Al. Reverse (); Flip entire set flip from big to small
for (int k = 0; k < n; k++)
{
Console.WriteLine (Al[k]);
}//output Order of discharge
Double h = 0;
for (int j = 0; J < N; j + +)
{
H + = convert.todouble (Al[j]); Here the elements are taken out according to the subscript and calculated and
}
Double x = ((H-convert.todouble (al[0])-convert.todouble (al[n-1])/(n-2)); Index starting from 0 so the highest is divided into al[0], the lowest is divided into al[n-1]
Console.WriteLine ("Total Divided into:" +h);
Console.WriteLine ("Remove the highest and lowest average divided into:" +x);
Console.ReadLine ();
}
Set sort averaging