Advertisement
terlichki

Untitled

Jun 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Problem_3___Tseam_Account
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. List<string> games = Console.ReadLine().Split(" ").ToList();
  13. string comand = Console.ReadLine();
  14.  
  15.  
  16. while (comand !="Play!")
  17. {
  18. string[] arr = comand.Split(' ').ToArray();
  19. string comandToDo = arr[0];
  20. string game = arr[1];
  21. if (comand == "Play!")
  22. {
  23. break;
  24. }
  25. switch (comandToDo) {
  26.  
  27. case "Install":
  28. if (!games.Contains(game))
  29. {
  30. games.Add(game);
  31. foreach (var item in games)
  32. {
  33. Console.WriteLine(string.Join(' ', item));
  34. }
  35. }
  36.  
  37. break;
  38. case "Uninstall":
  39. if (games.Contains(game))
  40. {
  41. games.Remove(game);
  42.  
  43. foreach (var item in games)
  44. {
  45. Console.WriteLine(string.Join(' ', item));
  46. }
  47. }
  48.  
  49. break;
  50. case "Update":
  51. if (games.Contains(game))
  52. {
  53. games.Remove(game);
  54. games.Add(game);
  55. }
  56. foreach (var item in games)
  57. {
  58. Console.Write(string.Join(" ",item));
  59. }
  60.  
  61. break;
  62. case "Expansion":
  63.  
  64. string[] Exppend = arr[1].Split("-").ToArray();
  65. string gametoExpend = Exppend[0];
  66. string expend = ":"+ Exppend[1];
  67. if (games.Contains(gametoExpend))
  68. {
  69.  
  70. }
  71.  
  72. break;
  73. }
  74.  
  75. }
  76. }
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement