Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class BasketBattle
- {
- static void Main()
- {
- string inputName = Console.ReadLine();
- string[] names = { "Simeon", "Nakov" };
- if (names[0] != inputName)
- {
- Array.Reverse(names);
- }
- int rounds = int.Parse(Console.ReadLine());
- int maxScores = 500;
- int amountPoint = 0;
- string successful = "";
- int resultFirstPlayer = 0;
- int resultSecondPlayer = 0;
- int count = 1;
- for (int i = 0; i < rounds; i++)
- {
- if (i % 2 == 0)
- {
- amountPoint = int.Parse(Console.ReadLine());
- successful = Console.ReadLine();
- if (successful == "success")
- {
- resultFirstPlayer += amountPoint;
- }
- amountPoint = int.Parse(Console.ReadLine());
- successful = Console.ReadLine();
- if (successful == "success")
- {
- resultSecondPlayer += amountPoint;
- }
- }
- else
- {
- amountPoint = int.Parse(Console.ReadLine());
- successful = Console.ReadLine();
- if (successful == "success")
- {
- resultSecondPlayer += amountPoint;
- }
- amountPoint = int.Parse(Console.ReadLine());
- successful = Console.ReadLine();
- if (successful == "success")
- {
- resultFirstPlayer += amountPoint;
- }
- }
- if (resultFirstPlayer >= maxScores || resultSecondPlayer >= maxScores)
- {
- if (resultFirstPlayer >= 500)
- {
- Console.WriteLine("{0}", names[0]);
- Console.WriteLine("{0}", count);
- Console.WriteLine("{0}", resultSecondPlayer);
- return;
- }
- else if (resultSecondPlayer >= 500)
- {
- Console.WriteLine("{0}", names[1]);
- Console.WriteLine("{0}", count);
- Console.WriteLine("{0}", resultFirstPlayer);
- return;
- }
- }
- count++;
- }
- if (resultFirstPlayer == resultSecondPlayer)
- {
- Console.WriteLine("DRAW");
- Console.WriteLine("{0}", resultFirstPlayer);
- }
- else
- {
- if (resultFirstPlayer > resultSecondPlayer)
- {
- Console.WriteLine("{0}", names[0]);
- Console.WriteLine("{0}", resultFirstPlayer - resultSecondPlayer);
- }
- else
- {
- Console.WriteLine("{0}", names[1]);
- Console.WriteLine("{0}", resultSecondPlayer - resultFirstPlayer);
- }
- }
- }
- }
- /*
- 1*
- Simeon
- 3
- 300
- success
- 200
- fail
- 400
- success
- 200
- success
- 2*
- Nakov
- 3
- 150
- success
- 100
- fail
- 150
- success
- 50
- success
- 150
- success
- 70
- success
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement