Advertisement
Atanasov_88

ArraysInputSort

Sep 15th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4.     class Problem_2_SoftUni
  5.     {
  6.         static void Main()
  7.         {
  8.             Console.WriteLine("Enter array number: " );
  9.             int[] numbers = Console.ReadLine().Split().Select(int.Parse).ToArray();
  10.  
  11.             foreach (var number in numbers)
  12.             {
  13.                 Console.Write(" " + number + " ");
  14.             }
  15.             Console.WriteLine();
  16.  
  17.             Array.Sort(numbers);
  18.  
  19.             foreach (var number in numbers)
  20.             {
  21.                 Console.Write(" " + number + " ");
  22.             }
  23.  
  24.            
  25.            
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement