Проблем със задача 04. Darts
Здравейте!
Може ли насока относно тази задача, judge ми дава само 50/100 а в zero test-овете нямам грешка.
Линк към задачата - https://judge.softuni.org/Contests/Practice/Index/1538#7
Моето решение:
using System;
using System.Runtime.CompilerServices;
namespace _04._Darts
{
internal class Program
{
static void Main(string[] args)
{
string playerName = Console.ReadLine();
string input = Console.ReadLine();
double beginnerPoints = 301;
int success = 0;
int fail = 0;
while (input != "Retire")
{
int points = int.Parse(Console.ReadLine());
if (beginnerPoints < 0)
{
beginnerPoints = 1;
}
if (beginnerPoints >= points)
{
success++;
}
else
{
fail++;
}
if (input == "Single")
{
beginnerPoints -= points;
}
else if (input == "Double")
{
points *= 2;
beginnerPoints -= points;
}
else if (input == "Triple")
{
points *= 3;
beginnerPoints -= points;
}
if (beginnerPoints == 0 || beginnerPoints == -1)
{
Console.WriteLine($"{playerName} won the leg with {success} shots.");
break;
}
input = Console.ReadLine();
}
if (input == "Retire")
{
Console.WriteLine($"{playerName} retired after {fail} unsuccessful shots.");
}
}
}
}
Благодаря предварително! :)