Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace The_football_statistician
- {
- class Program
- {
- static void Main(string[] args)
- {
- var payment = decimal.Parse(Console.ReadLine());
- string match = Console.ReadLine();
- int arsenalPoint = 0, chelsea = 0, manCity = 0, manUnited = 0, liverpool = 0, everton = 0, south = 0, totnem = 0, matchCount =0;
- while (match!= "End of the league.")
- {
- string[] matchSplit = match.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- matchCount++;
- if (matchSplit[1]=="1")
- {
- switch (matchSplit[0].ToLower())
- {
- case "arsenal":arsenalPoint += 3;break;
- case "chelsea": chelsea += 3;break;
- case "manchestercity": manCity += 3;break;
- case "manchesterunited": manUnited += 3;break;
- case "liverpool": liverpool += 3;break;
- case "everton": everton += 3;break;
- case "southampton": south += 3;break;
- case "tottenham": totnem += 3;break;
- }
- }
- else if (matchSplit[1] == "2")
- {
- switch (matchSplit[2].ToLower())
- {
- case "arsenal": arsenalPoint += 3; break;
- case "chelsea": chelsea += 3; break;
- case "manchestercity": manCity += 3; break;
- case "manchesterunited": manUnited += 3; break;
- case "liverpool": liverpool += 3; break;
- case "everton": everton += 3; break;
- case "southampton": south += 3; break;
- case "tottenham": totnem += 3; break;
- }
- }
- else if (matchSplit[1] == "X")
- {
- switch (matchSplit[2].ToLower())
- {
- case "arsenal": arsenalPoint ++; break;
- case "chelsea": chelsea ++; break;
- case "manchestercity": manCity ++; break;
- case "manchesterunited": manUnited ++; break;
- case "liverpool": liverpool ++; break;
- case "everton": everton ++; break;
- case "southampton": south ++; break;
- case "tottenham": totnem ++; break;
- }
- switch (matchSplit[0].ToLower())
- {
- case "arsenal": arsenalPoint++; break;
- case "chelsea": chelsea++; break;
- case "manchestercity": manCity++; break;
- case "manchesterunited": manUnited++; break;
- case "liverpool": liverpool++; break;
- case "everton": everton++; break;
- case "southampton": south++; break;
- case "tottenham": totnem++; break;
- }
- }
- match = Console.ReadLine();
- }
- var moneyIncome = payment * matchCount * 1.94m;
- Console.WriteLine("{0:f2}lv.", moneyIncome);
- Console.WriteLine("Arsenal - {0} points.", arsenalPoint);
- Console.WriteLine("Chelsea - {0} points.", chelsea);
- Console.WriteLine("Everton - {0} points.", everton);
- Console.WriteLine("Liverpool - {0} points.", liverpool);
- Console.WriteLine("Manchester City - {0} points.", manCity);
- Console.WriteLine("Manchester United - {0} points.", manUnited);
- Console.WriteLine("Southampton - {0} points.", south);
- Console.WriteLine("Tottenham - {0} points.", totnem);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment