Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace TseamAccount
- {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- public static void Main()
- {
- List<string> gameCollections = Console.ReadLine().Split().ToList();
- string[] input = Console.ReadLine().Split();
- while (input[0] != "Play!")
- {
- string command = input[0];
- string gameName = input[1];
- if (command == "Install")
- {
- if (!gameCollections.Contains(gameName))
- {
- gameCollections.Add(gameName);
- }
- }
- else if (command == "Uninstall")
- {
- if (gameCollections.Contains(gameName))
- {
- gameCollections.Remove(gameName);
- }
- }
- else if (command == "Update")
- {
- if (gameCollections.Contains(gameName))
- {
- gameCollections.Remove(gameName);
- gameCollections.Add(gameName);
- }
- }
- else if (command == "Expansion")
- {
- string game = gameName.Split('-')[0];
- string expansion = gameName.Split('-')[1];
- if (gameCollections.Contains(game))
- {
- int index = gameCollections.IndexOf(game);
- gameCollections.Insert(index + 1, game + ':' + expansion);
- }
- }
- input = Console.ReadLine().Split();
- }
- Console.WriteLine(string.Join(" ", gameCollections));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement