Advertisement
Aborigenius

RandomizeWords

Aug 18th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace RandomizeWords
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string[] words = Console.ReadLine().Split(' ');
  15.  
  16.           Random rnd = new Random(13);
  17.           for (int i = 0; i < words.Length; i++)
  18.           {
  19.                 int index = rnd.Next(0, words.Length);
  20.  
  21.                 string temp = words[i];
  22.                 words[i] = words[index];
  23.                 words[index] = temp;
  24.           }
  25.  
  26.             words.ToList().ForEach(Console.WriteLine);
  27.  
  28.        //  WebClient webClient = new WebClient();
  29.        //  webClient.DownloadFile("https://softuni.bg/trainings/resources/officedocument/16726/presentation-programming-fundamentals-extended-may-2017", "pr.pdf");
  30.        //  WebProxy wp = new WebProxy("http://proxy:8080");
  31.        //  webClient.Proxy = wp;
  32.  
  33.  
  34.         }
  35.  
  36.    
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement