Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace SoftUni_Party
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- HashSet<string> VIPguests = new HashSet<string>();
- HashSet<string> REGULARguests = new HashSet<string>();
- int count = 0;
- while (input!="PARTY")
- {
- string reservation = input;
- if (char.IsDigit(reservation[0]))
- {
- VIPguests.Add(reservation);
- }
- else
- {
- REGULARguests.Add(reservation);
- }
- count++;
- input = Console.ReadLine();
- }
- string newInput = Console.ReadLine();
- while (newInput != "END")
- {
- string guest = newInput;
- if (VIPguests.Contains(guest))
- {
- VIPguests.Remove(guest);
- count--;
- }
- else if (REGULARguests.Contains(guest))
- {
- REGULARguests.Remove(guest);
- count--;
- }
- newInput = Console.ReadLine();
- }
- Console.WriteLine(count);
- foreach (var guest in VIPguests)
- {
- Console.WriteLine(guest);
- }
- foreach (var guest in REGULARguests)
- {
- Console.WriteLine(guest);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment