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;
- class Program
- {
- static void Main()
- {
- int nakovsPoints = 0;
- int simeonsPoints = 0;
- int rounds = 0;
- string playerToStart = Console.ReadLine();
- int numberOfRounds = int.Parse(Console.ReadLine());
- for (int i = 0; i < numberOfRounds; i++)
- {
- rounds++;
- if (playerToStart == "Simeon")
- {
- int pointsToScore = int.Parse(Console.ReadLine());
- string whatHeDone = Console.ReadLine();
- if (whatHeDone == "success")
- {
- if (simeonsPoints + pointsToScore <= 500)
- {
- simeonsPoints += pointsToScore;
- }
- }
- if (simeonsPoints == 500)
- {
- Console.WriteLine("Simeon");
- Console.WriteLine(rounds);
- Console.WriteLine(nakovsPoints);
- return;
- }
- pointsToScore = int.Parse(Console.ReadLine());
- whatHeDone = Console.ReadLine();
- if (whatHeDone == "success")
- {
- if (nakovsPoints + pointsToScore <= 500)
- {
- nakovsPoints += pointsToScore;
- }
- }
- playerToStart = "Nakov";
- if (nakovsPoints == 500)
- {
- Console.WriteLine("Nakov");
- Console.WriteLine(rounds);
- Console.WriteLine(simeonsPoints);
- return;
- }
- }
- else
- {
- int pointsToScore = int.Parse(Console.ReadLine());
- string whatHeDone = Console.ReadLine();
- if (whatHeDone == "success")
- {
- if (nakovsPoints + pointsToScore <= 500)
- {
- nakovsPoints += pointsToScore;
- }
- }
- if (nakovsPoints == 500)
- {
- Console.WriteLine("Nakov");
- Console.WriteLine(rounds);
- Console.WriteLine(simeonsPoints);
- return;
- }
- pointsToScore = int.Parse(Console.ReadLine());
- whatHeDone = Console.ReadLine();
- if (whatHeDone == "success")
- {
- if (simeonsPoints + pointsToScore <= 500)
- {
- simeonsPoints += pointsToScore;
- }
- }
- playerToStart = "Simeon";
- if (simeonsPoints == 500)
- {
- Console.WriteLine("Simeon");
- Console.WriteLine(rounds);
- Console.WriteLine(nakovsPoints);
- return;
- }
- }
- }
- if (simeonsPoints == nakovsPoints)
- {
- Console.WriteLine("DRAW");
- Console.WriteLine(simeonsPoints);
- }
- else if (simeonsPoints > nakovsPoints)
- {
- Console.WriteLine("Simeon");
- Console.WriteLine(simeonsPoints - nakovsPoints);
- }
- else
- {
- Console.WriteLine("Nakov");
- Console.WriteLine(nakovsPoints - simeonsPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement