High Jump Programming Basics with C#
Имам нужда от помощ. В judge ми дава 60/100 и не мога да намеря къде е грешката.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighJump
{
class Program
{
static void Main()
{
int goal = int.Parse(Console.ReadLine());
int setionGoal = goal - 30;
int jump = int.Parse(Console.ReadLine());
int failAttempts = 0;
bool succesful = false;
bool fail = false;
int counter = 0;
while (fail == false || succesful == false)
{
counter++;
if (jump > setionGoal)
{
setionGoal += 5;
failAttempts = 0;
if (jump >= goal)
{
Console.WriteLine($"Tihomir succeeded, he jumped over {goal}cm after {counter} jumps.");
return;
}
jump = int.Parse(Console.ReadLine());
}
else if (jump <= setionGoal)
{
failAttempts++;
if (failAttempts == 3)
{
Console.WriteLine($"Tihomir failed at {setionGoal}cm after { counter} jumps.");
return;
}
jump = int.Parse(Console.ReadLine());
}
}
}
}
}
https://softuni.bg/downloads/svn/programming-basics-v4/course-directories/may-2019/2019-01/Exam/06.%20High%20Jump.pdf