Advertisement
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 Basket
- {
- class Program
- {
- static void Main(string[] args)
- {
- string player = Console.ReadLine();
- int rounds = int.Parse(Console.ReadLine());
- int simeonScore = 0;
- int nakovScore = 0;
- int round = 0;
- string winner = "";
- int loserPoints = 0;
- for (int i = 0; i < rounds * 2; i++)
- {
- int points = int.Parse(Console.ReadLine());
- string info = Console.ReadLine();
- if (i % 2 == 0)
- {
- if (player == "Simeon")
- {
- player = "Simeon";
- }
- else
- {
- player = "Nakov";
- }
- }
- else
- {
- if (player == "Simeon")
- {
- player = "Nakov";
- }
- else
- {
- player = "Simeon";
- }
- }
- if (info == "success" && player == "Simeon")
- {
- simeonScore += points;
- if (simeonScore > 500)
- {
- simeonScore -= points;
- }
- }
- if (info == "success" && player == "Nakov")
- {
- nakovScore += points;
- if (nakovScore > 500)
- {
- nakovScore -= points;
- }
- }
- if (simeonScore == 500 || nakovScore == 500)
- {
- round = i / 2 + 1;
- break;
- }
- }
- if (nakovScore == 500 || simeonScore == 500)
- {
- if (nakovScore == 500)
- {
- winner = "Nakov";
- loserPoints = simeonScore;
- }
- else if (simeonScore == 500)
- {
- winner = "Simeon";
- loserPoints = nakovScore;
- }
- Console.WriteLine(winner);
- Console.WriteLine(round);
- Console.WriteLine(loserPoints);
- }
- else if (simeonScore != 500 && nakovScore != 500 && simeonScore == nakovScore)
- {
- Console.WriteLine("DRAW");
- Console.WriteLine(nakovScore);
- }
- else if (simeonScore != 500 && nakovScore != 500 && nakovScore != simeonScore)
- {
- if (nakovScore > simeonScore)
- {
- Console.WriteLine("Nakov");
- }
- else
- {
- Console.WriteLine("Simeon");
- }
- Console.WriteLine(Math.Abs(simeonScore - nakovScore));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement