Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace The_football_statistician
- {
- class TheFootballStatistician
- {
- static void Main(string[] args)
- {
- var payment = double.Parse(Console.ReadLine());
- var playCount = 0;
- var pointsArsenal = 0;
- var pointsChelsea = 0;
- var pointsMCity = 0;
- var pointsMUnited = 0;
- var pointsLiverpool = 0;
- var pointsEverton = 0;
- var pointsSouthampton = 0;
- var pointsTottenham = 0;
- while (true)
- {
- var line = Console.ReadLine();
- if (line == "End of the league.")
- {
- break;
- }
- string[] parameters = line.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
- var team1 = parameters[0];
- var team2 = parameters[2];
- var result = parameters[1];
- var team1Points = 0;
- var team2Points = 0;
- if (result == "1")
- {
- team1Points = 3;
- team2Points = 0;
- }
- else if (result == "X")
- {
- team1Points = 1;
- team2Points = 1;
- }
- else if (result == "2")
- {
- team1Points = 0;
- team2Points = 3;
- }
- switch (team1)
- {
- case "Arsenal":
- pointsArsenal += team1Points;
- break;
- case "Chelsea":
- pointsChelsea += team1Points;
- break;
- case "ManchesterCity":
- pointsMCity += team1Points;
- break;
- case "ManchesterUnited":
- pointsMUnited += team1Points;
- break;
- case "Liverpool":
- pointsLiverpool += team1Points;
- break;
- case "Everton":
- pointsEverton += team1Points;
- break;
- case "Southampton":
- pointsSouthampton += team1Points;
- break;
- case "Tottenham":
- pointsTottenham += team1Points;
- break;
- }
- switch (team2)
- {
- case "Arsenal":
- pointsArsenal += team2Points;
- break;
- case "Chelsea":
- pointsChelsea += team2Points;
- break;
- case "ManchesterCity":
- pointsMCity += team2Points;
- break;
- case "ManchesterUnited":
- pointsMUnited += team2Points;
- break;
- case "Liverpool":
- pointsLiverpool += team2Points;
- break;
- case "Everton":
- pointsEverton += team2Points;
- break;
- case "Southampton":
- pointsSouthampton += team2Points;
- break;
- case "Tottenham":
- pointsTottenham += team2Points;
- break;
- }
- playCount++;
- }
- Console.WriteLine("{0:f2}lv.", playCount * payment * 1.94);
- Console.WriteLine("Arsenal - {0} points.", pointsArsenal);
- Console.WriteLine("Chelsea - {0} points.", pointsChelsea);
- Console.WriteLine("Everton - {0} points.", pointsEverton);
- Console.WriteLine("Liverpool - {0} points.", pointsLiverpool);
- Console.WriteLine("Manchester City - {0} points.", pointsMCity);
- Console.WriteLine("Manchester United - {0} points.", pointsMUnited);
- Console.WriteLine("Southampton - {0} points.", pointsSouthampton);
- Console.WriteLine("Tottenham - {0} points.", pointsTottenham);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement