fiher

Untitled

May 31st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6. using System.Threading.Tasks;
  7.  
  8. namespace _01.ParkingLot
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. HashSet<string> parkingLot = new HashSet<string>();
  15. var input = Regex.Split(Console.ReadLine(),", ");
  16. while(input[0] != "END")
  17. {
  18. if(input[0] == "IN")
  19. {
  20. parkingLot.Add(input[1]);
  21. }
  22. else
  23. {
  24. parkingLot.Remove(input[1]);
  25. }
  26. input = Regex.Split(Console.ReadLine(), ", ");
  27. }
  28. if (parkingLot.Count() == 0)
  29. {
  30. Console.WriteLine("Parking Lot is Empty");
  31. }
  32. foreach(var ch in parkingLot)
  33. {
  34. Console.WriteLine(ch);
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment