Bradara

The_football_statistician

Nov 13th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.07 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.  
  7. namespace The_football_statistician
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var payment = decimal.Parse(Console.ReadLine());
  14.             string match = Console.ReadLine();
  15.             int arsenalPoint = 0, chelsea = 0, manCity = 0, manUnited = 0, liverpool = 0, everton = 0, south = 0, totnem = 0, matchCount =0;
  16.  
  17.             while (match!= "End of the league.")
  18.             {
  19.                 string[] matchSplit = match.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
  20.                 matchCount++;
  21.                 if (matchSplit[1]=="1")
  22.                 {
  23.                     switch (matchSplit[0].ToLower())
  24.                     {
  25.                         case "arsenal":arsenalPoint += 3;break;
  26.                         case "chelsea": chelsea += 3;break;
  27.                         case "manchestercity": manCity += 3;break;
  28.                         case "manchesterunited": manUnited += 3;break;
  29.                         case "liverpool": liverpool += 3;break;
  30.                         case "everton": everton += 3;break;
  31.                         case "southampton": south += 3;break;
  32.                         case "tottenham": totnem += 3;break;
  33.                     }
  34.                 }
  35.                 else if (matchSplit[1] == "2")
  36.                 {
  37.                     switch (matchSplit[2].ToLower())
  38.                     {
  39.                         case "arsenal": arsenalPoint += 3; break;
  40.                         case "chelsea": chelsea += 3; break;
  41.                         case "manchestercity": manCity += 3; break;
  42.                         case "manchesterunited": manUnited += 3; break;
  43.                         case "liverpool": liverpool += 3; break;
  44.                         case "everton": everton += 3; break;
  45.                         case "southampton": south += 3; break;
  46.                         case "tottenham": totnem += 3; break;
  47.                     }
  48.                 }
  49.                 else if (matchSplit[1] == "X")
  50.                 {
  51.                     switch (matchSplit[2].ToLower())
  52.                     {
  53.                         case "arsenal": arsenalPoint ++; break;
  54.                         case "chelsea": chelsea ++; break;
  55.                         case "manchestercity": manCity ++; break;
  56.                         case "manchesterunited": manUnited ++; break;
  57.                         case "liverpool": liverpool ++; break;
  58.                         case "everton": everton ++; break;
  59.                         case "southampton": south ++; break;
  60.                         case "tottenham": totnem ++; break;
  61.                     }
  62.  
  63.                     switch (matchSplit[0].ToLower())
  64.                     {
  65.                         case "arsenal": arsenalPoint++; break;
  66.                         case "chelsea": chelsea++; break;
  67.                         case "manchestercity": manCity++; break;
  68.                         case "manchesterunited": manUnited++; break;
  69.                         case "liverpool": liverpool++; break;
  70.                         case "everton": everton++; break;
  71.                         case "southampton": south++; break;
  72.                         case "tottenham": totnem++; break;
  73.                     }
  74.                 }
  75.                 match = Console.ReadLine();
  76.             }
  77.             var moneyIncome = payment * matchCount * 1.94m;
  78.             Console.WriteLine("{0:f2}lv.", moneyIncome);
  79.             Console.WriteLine("Arsenal - {0} points.", arsenalPoint);
  80.             Console.WriteLine("Chelsea - {0} points.", chelsea);
  81.             Console.WriteLine("Everton - {0} points.", everton);
  82.             Console.WriteLine("Liverpool - {0} points.", liverpool);
  83.             Console.WriteLine("Manchester City - {0} points.", manCity);
  84.             Console.WriteLine("Manchester United - {0} points.", manUnited);
  85.             Console.WriteLine("Southampton - {0} points.", south);
  86.             Console.WriteLine("Tottenham - {0} points.", totnem);
  87.         }
  88.     }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment