Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TheFootballStatistician
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal pricePer = decimal.Parse(Console.ReadLine());
- string match = "";
- string[] teams = { "Arsenal", "Chelsea","Everton","Liverpool" ,
- "ManchesterCity", "ManchesterUnited" ,"Southampton","Tottenham" };
- string[] outcomes = { "1", "X", "2" };
- int[] points = new int[teams.Length];
- int counterOfGames = 0;
- while (!match.Equals("End of the league."))
- {
- match = Console.ReadLine();
- char[] delimiter = { ' ' };
- string[] splitted = match.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
- for (int i = 0; i < teams.Length; i++)
- {
- if (splitted[0] == teams[i])
- {
- for (int j = 0; j < outcomes.Length; j++)
- {
- if (splitted[1].Equals(outcomes[j]))
- {
- switch (outcomes[j])
- {
- case "1":
- points[i] += 3;
- break;
- case "X":
- points[i]++;
- for (int team = 0; team < teams.Length; team++)
- {
- if (splitted[2] == teams[team])
- {
- points[team]++;
- }
- }
- break;
- case "2":
- {
- for (int team = 0; team < teams.Length; team++)
- {
- if (splitted[2] == teams[team])
- {
- points[team] += 3;
- }
- }
- break;
- }
- }
- }
- }
- }
- }
- counterOfGames++;
- }
- if (counterOfGames > 1)
- {
- counterOfGames--;
- }
- decimal priceForAll = (pricePer * counterOfGames) * 1.94m;
- Console.WriteLine(String.Format("{0:F2}lv.", priceForAll));
- for (int i = 0; i < teams.Length; i++)
- switch (teams[i])
- {
- case "ManchesterCity": Console.WriteLine("Manchester City - " + points[i] + " points."); break;
- case "ManchesterUnited": Console.WriteLine("Manchester United - " + points[i] + " points."); break;
- default: Console.WriteLine(teams[i] + " - " + points[i] + " points."); break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement