• Share this text:
Report Abuse
Untitled - posted by guest on 17th August 2020 03:46:42 PM

using System;


public class Array

{

    static public void Main ()

    {

        Console.WriteLine("How many students are in your class");

   int num = Convert.ToInt32(Console.ReadLine());

   

   string[]students = new string[num];

   

   for (int i = 0;i < num;i++)

   {

    students[i] = Console.ReadLine();

   }

   

   Console.WriteLine("----------------");

   

   Array.Sort(students)

   

   for (int i = 0;i < num;i++)

   {

    int rank = i + 1;

   Console.WriteLine(rank + "/ " + students[i]);

   }

    }

}


Report Abuse

Login or Register to edit or copy and save this text. It's free.