High Jump
Здравейте ,опитвам се да реша следната задача : https://softuni.bg/downloads/svn/programming-basics-v4/course-directories/may-2019/2019-01/Exam/06.%20High%20Jump.pdf
Не успявам :( .Някой ,ако може да помогне,моя код:
wanted_height = int(input())
attempts = 0
unsuccessful_jumps = 0
started_height = wanted_height - 30
while True:
current_jump = int(input())
attempts += 1
if started_height >= current_jump:
unsuccessful_jumps += 1
if unsuccessful_jumps == 3:
print(f'Tihomir failed at {started_height}cm after {attempts} jumps.')
else:
started_height += 5
if started_height > wanted_height:
started_height -= 5
print(f'Tihomir succeeded, he jumped over {started_height}cm after {attempts} jumps.')