Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Numerics;
- using System.Text;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- int times = int.Parse(Console.ReadLine());
- List<string> isGoing = new List<string>();
- for (int i = 0; i < times; i++)
- {
- List<string> input = Console.ReadLine().Split().ToList();
- if (input.Count == 3)
- {
- if (isGoing.Contains(input[0]))
- {
- Console.WriteLine($"{input[0]} is already in the list!");
- }
- else
- {
- isGoing.Add(input[0]);
- }
- }
- else
- {
- if (isGoing.Contains(input[0]))
- {
- isGoing.Remove(input[0]);
- }
- else
- {
- Console.WriteLine($"{input[0]} is not in the list!");
- }
- }
- }
- Console.WriteLine(string.Join(Environment.NewLine, isGoing));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement