BubaLazi

02.PlaylistSort

Jul 17th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 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 ArraysLab
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             string[] blacklistedSongs = Console.ReadLine().Split(' ');
  15.             string song = Console.ReadLine();
  16.             List<string> playlist = new List<string>();
  17.             while(song != "end")
  18.             {
  19.                 bool isConstaned = false;
  20.                 for(int i =0; i< blacklistedSongs.Length; i++)
  21.                 {
  22.                     if(song.Contains(blacklistedSongs[i]))
  23.                     {
  24.                         isConstaned = true;
  25.                     }
  26.                    
  27.                 }
  28.                 if (!isConstaned)
  29.                 {
  30.                     playlist.Add(song);
  31.                 }
  32.                 song = Console.ReadLine();                
  33.             }
  34.             playlist.Sort();
  35.             Console.WriteLine(string.Join("\r\n", playlist));
  36.         }
  37.        
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment