Advertisement
Guest User

Untitled

a guest
Oct 12th, 2015
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class TheFootballStatistician
  5. {
  6. static void Main()
  7. {
  8. decimal payment = decimal.Parse(Console.ReadLine());
  9. int multiply = 0;
  10. var table = new Dictionary<string, int>();
  11. table.Add("Arsenal", 0);
  12. table.Add("Chelsea", 0);
  13. table.Add("Everton", 0);
  14. table.Add("Liverpool", 0);
  15. table.Add("Manchester City", 0);
  16. table.Add("Manchester United", 0);
  17. table.Add("Southampton", 0);
  18. table.Add("Tottenham", 0);
  19.  
  20. while (true)
  21. {
  22. string game = Console.ReadLine();
  23. string[] match = game.Split(new string[] { }, StringSplitOptions.RemoveEmptyEntries);
  24. if (game != "End of the league.")
  25. {
  26. for (int i = 0; i <= 2; i += 2)
  27. {
  28. for (int j = 1; j < match[i].Length; j++)
  29. {
  30. if (Char.IsUpper(match[i][j]))
  31. {
  32. match[i] = match[i].Insert(j, " ");
  33. break;
  34. }
  35. }
  36. }
  37.  
  38. int gameResult = 0;
  39. table[match[0]] += gameResult = match[1] == "1" ? 3 : (match[1] == "X" ? 1 : 0);
  40. table[match[2]] += gameResult = match[1] == "1" ? 0 : (match[1] == "X" ? 1 : 3);
  41. multiply++;
  42. }
  43. else
  44. {
  45. break;
  46. }
  47. }
  48.  
  49. Console.WriteLine("{0:F2}lv.", payment * multiply * 1.94M);
  50. foreach (var pair in table)
  51. {
  52. Console.WriteLine("{0} - {1} points.", pair.Key, pair.Value);
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement