static void Main (string[] args)
{
ArrayList al = new ArrayList ();//collection All types can be put into
Console.Write ("Please enter the number of people:");
int n = Convert.ToInt32 (Console.ReadLine ());//numeric type that turns the number of string types to integers
for (int i = 0; i < n; i++)//start loop. Cycle count equals number of people
{
Console.Write ("Please enter the" + (i + 1) + "score:"),//array subscript is starting from 0, so add 1
Al. Add (Convert.ToInt32 (Console.ReadLine ()));//Adds the object to the end of the arrylist and transforms it to place the score in the Al collection
}
Double sum = 0;
for (int b = 0; b < n; b++)//Calculate total Score
{
sum = sum + convert.todouble (al[b]. ToString ());
}
Double avg = sum/n;
Console.WriteLine ("Total score is" + sum);
Console.WriteLine ("Average divided" + avg);
Al. Sort ();//input sort order
Al. Reverse ();//Invert the command, execute it and turn it into descending order
for (int d = 0; d < n; d++)//output ranked score
{
Console.WriteLine (Al[d]);
}
Console.ReadLine ();
Example: The average score of the total score is calculated by set.