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;
- using System.Globalization;
- using System.Threading;
- namespace ConsoleApplication32
- {
- class Program
- {
- static void Main(string[] args)
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- decimal payment = decimal.Parse(Console.ReadLine(), System.Globalization.CultureInfo.InvariantCulture);
- //string command = "";
- //Console.WriteLine("On the next lines you are given several input lines");
- string inputline = "";
- string result = "";
- int arsenalPoints = 0;
- int chelseaPoints = 0;
- int manchesterCityPoints = 0;
- int manchesterUnitedPoints = 0;
- int liverpoolPoints = 0;
- int evertonPoints = 0;
- int southamptonPoints = 0;
- int tottenhamPoints = 0;
- int matchesCounter = 0;
- while (inputline != "End of the league.")
- {
- matchesCounter++;
- inputline = Console.ReadLine();
- char[] delimiter = { ' ' };
- string[] matchInfo = inputline.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
- string homeTeam = matchInfo[0];
- result = matchInfo[1];
- string guestTeam = matchInfo[2];
- if (homeTeam == "Arsenal" && result == "1")
- {
- arsenalPoints = arsenalPoints + 3;
- }
- else if (homeTeam == "Arsenal" && result == "X")
- {
- arsenalPoints = arsenalPoints + 1;
- }
- if (homeTeam == "Chelsea" && result == "1")
- {
- chelseaPoints = chelseaPoints + 3;
- }
- else if (homeTeam == "Chelsea" && result == "X")
- {
- chelseaPoints = chelseaPoints + 1;
- }
- if (homeTeam == "ManchesterCity" && result == "1")
- {
- manchesterCityPoints = manchesterCityPoints + 3;
- }
- else if (homeTeam == "ManchesterCity" && result == "X")
- {
- manchesterCityPoints = manchesterCityPoints + 1;
- }
- if (homeTeam == "ManchesterUnited" && result == "1")
- {
- manchesterUnitedPoints = manchesterUnitedPoints + 3;
- }
- else if (homeTeam == "ManchesterUnited" && result == "X")
- {
- manchesterUnitedPoints = manchesterUnitedPoints + 1;
- }
- if (homeTeam == "Liverpool" && result == "1")
- {
- liverpoolPoints = liverpoolPoints + 3;
- }
- else if (homeTeam == "Liverpool" && result == "X")
- {
- liverpoolPoints = liverpoolPoints + 1;
- }
- if (homeTeam == "Everton" && result == "1")
- {
- evertonPoints = evertonPoints + 3;
- }
- else if (homeTeam == "Everton" && result == "X")
- {
- evertonPoints = evertonPoints + 1;
- }
- if (homeTeam == "Southampton" && result == "1")
- {
- southamptonPoints = southamptonPoints + 3;
- }
- else if (homeTeam == "Southampton" && result == "X")
- {
- southamptonPoints = southamptonPoints + 1;
- }
- if (homeTeam == "Tottenham" && result == "1")
- {
- tottenhamPoints = tottenhamPoints + 3;
- }
- else if (homeTeam == "Tottenham" && result == "X")
- {
- tottenhamPoints = tottenhamPoints + 1;
- }
- if (guestTeam == "Arsenal" && result == "2")
- {
- arsenalPoints = arsenalPoints + 3;
- }
- else if (guestTeam == "Arsenal" && result == "X")
- {
- arsenalPoints = arsenalPoints + 1;
- }
- if (guestTeam == "Chelsea" && result == "2")
- {
- chelseaPoints = chelseaPoints + 3;
- }
- else if (guestTeam == "Chelsea" && result == "X")
- {
- chelseaPoints = chelseaPoints + 1;
- }
- if (guestTeam == "ManchesterCity" && result == "2")
- {
- manchesterCityPoints = manchesterCityPoints + 3;
- }
- else if (guestTeam == "ManchesterCity" && result == "X")
- {
- manchesterCityPoints = manchesterCityPoints + 1;
- }
- if (guestTeam == "ManchesterUnited" && result == "2")
- {
- manchesterUnitedPoints = manchesterUnitedPoints + 3;
- }
- else if (guestTeam == "ManchesterUnited" && result == "X")
- {
- manchesterUnitedPoints = manchesterUnitedPoints + 1;
- }
- if (guestTeam == "Liverpool" && result == "2")
- {
- liverpoolPoints = liverpoolPoints + 3;
- }
- else if (guestTeam == "Liverpool" && result == "X")
- {
- liverpoolPoints = liverpoolPoints + 1;
- }
- if (guestTeam == "Everton" && result == "2")
- {
- evertonPoints = evertonPoints + 3;
- }
- else if (guestTeam == "Everton" && result == "X")
- {
- evertonPoints = evertonPoints + 1;
- }
- if (guestTeam == "Southampton" && result == "2")
- {
- southamptonPoints = southamptonPoints + 3;
- }
- else if (guestTeam == "Southampton" && result == "X")
- {
- southamptonPoints = southamptonPoints + 1;
- }
- if (guestTeam == "Tottenham" && result == "2")
- {
- tottenhamPoints = tottenhamPoints + 3;
- }
- else if (guestTeam == "Tottenham" && result == "X")
- {
- tottenhamPoints = tottenhamPoints + 1;
- }
- }
- // Console.ForegroundColor = ConsoleColor.Green;
- decimal priceForAllMatchesInLeva = ((matchesCounter - 1) * payment) * 1.94m;
- // Console.WriteLine("Number of matches: " + (matchesCounter-1));
- Console.WriteLine("{0:F2}lv.", priceForAllMatchesInLeva);
- Console.WriteLine("Arsenal - {0} points.", arsenalPoints);
- Console.WriteLine("Chelsea - {0} points.", chelseaPoints);
- Console.WriteLine("Everton - {0} points.", evertonPoints);
- Console.WriteLine("Liverpool - {0} points.", liverpoolPoints);
- Console.WriteLine("Manchester City - {0} points.", manchesterCityPoints);
- Console.WriteLine("Manchester United - {0} points.", manchesterUnitedPoints);
- Console.WriteLine("Southampton - {0} points.", southamptonPoints);
- Console.WriteLine("Tottenham - {0} points.", tottenhamPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment