Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- goal = int(input())
- starting_goal = goal - 30
- failed_attempts = 0
- counter = 0
- while True:
- current_jump = int(input())
- if current_jump <= starting_goal:
- failed_attempts += 1
- counter += 1
- elif current_jump > starting_goal:
- starting_goal += 5
- failed_attempts = 0
- counter += 1
- if failed_attempts == 3:
- print(f'Tihomir failed at {starting_goal}cm after {counter} jumps.')
- break
- if current_jump >= goal:
- print(f'Tihomir succeeded, he jumped over {current_jump}cm after {counter} jumps.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement