Advertisement
Atanasov_88

Untitled

Sep 18th, 2015
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. class SortArrayOfNumbers
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Enter n: ");
  8.  
  9.         int n = int.Parse(Console.ReadLine());
  10.         int[] sequence = new int[n];
  11.  
  12.         Console.WriteLine("Now, enter \"n\" numbers to see the sort numbers: ");
  13.  
  14.         for (int i = 0; i < sequence.Length; i++)
  15.         {
  16.             Console.Write("{0} number is: ", i+1);
  17.             sequence[i] = int.Parse(Console.ReadLine());  
  18.         }
  19.        Console.WriteLine();
  20.        
  21.         Console.WriteLine("Sort numbers are: ");
  22.  
  23.         for (int i = 0; i <sequence.Length; i++)
  24.         {
  25.             Array.Sort(sequence);
  26.            
  27.             Console.Write(sequence[i] + " ");
  28.         }
  29.        
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement