Advertisement
EmoRz

7_SoftUni Party

Sep 28th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace SoftUniParty
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             HashSet<string> listOfVIP = new HashSet<string>();
  12.             HashSet<string> listOfNormal = new HashSet<string>();
  13.             string[] numArr = { "0", "1", "2", "3", "4", "5","6", "7", "8", "9"};
  14.            
  15.             string input = Console.ReadLine();
  16.  
  17.             while (input != "PARTY")
  18.             {
  19.                 var testForNum = input[0].ToString();
  20.                 if (numArr.Contains(testForNum))
  21.                 {
  22.                     listOfVIP.Add(input);
  23.                 }
  24.                 else
  25.                 {
  26.                     listOfNormal.Add(input);
  27.                 }
  28.                 input = Console.ReadLine();
  29.             }
  30.  
  31.             while (input != "END")
  32.             {
  33.  
  34.                 var testForNum = input[0].ToString();
  35.                 if (numArr.Contains(testForNum))
  36.                 {
  37.                     listOfVIP.Remove(input);
  38.                 }
  39.                 else
  40.                 {
  41.                     listOfNormal.Remove(input);
  42.                 }
  43.                 input = Console.ReadLine();
  44.             }
  45.             var countGuestThatAreOut = listOfVIP.Count + listOfNormal.Count;
  46.             Console.WriteLine(countGuestThatAreOut);
  47.             if (listOfVIP.Count>0)
  48.             {
  49.                 Console.WriteLine(string.Join("\n", listOfVIP));
  50.             }
  51.             if (listOfNormal.Count > 0)
  52.             {
  53.                 Console.WriteLine(string.Join("\n", listOfNormal));
  54.             }
  55.  
  56.  
  57.  
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement