Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace Advanced
- {
- class Program
- {
- static void Main(string[] args)
- {
- var VIP = new HashSet<string>();
- var regular = new HashSet<string>();
- var pattern = @"^[0-9][\w]+";
- var input = Console.ReadLine();
- while (input != "PARTY")
- {
- if (Regex.IsMatch(input, pattern))
- {
- VIP.Add(input);
- }
- else
- {
- regular.Add(input);
- }
- input = Console.ReadLine();
- }
- input = Console.ReadLine();
- while (input != "END")
- {
- if (VIP.Contains(input))
- {
- VIP.Remove(input);
- }
- else
- {
- regular.Remove(input);
- }
- input = Console.ReadLine();
- }
- Console.WriteLine(VIP.Count + regular.Count);
- foreach (var guest in VIP)
- {
- Console.WriteLine(guest);
- }
- foreach (var guest in regular)
- {
- Console.WriteLine(guest);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement