Advertisement
SvPt

Untitled

May 5th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _02.RandomizeWords
  8. {
  9.     class RandomizeWords
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             List<string> input = Console.ReadLine().Split().ToList();
  14.             Random rnd = new Random();
  15.             List<string> result = new List<string>();
  16.  
  17.             while (input.Count() > 0)
  18.             {
  19.                 var random = rnd.Next(0, input.Count());
  20.                 result.Add(input[random]);
  21.                 input.RemoveAt(random);
  22.             }
  23.             Console.WriteLine(string.Join("\r\n", result));
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement