Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- height = int(input())
- starting = height - 30
- fail = 0
- counter = 0
- failed = False
- while starting <= height:
- jump = int(input())
- counter += 1
- if jump <= starting:
- fail += 1
- if fail == 3:
- failed = True
- break
- else:
- # if starting >= height:
- # break
- starting += 5
- fail = 0
- if not failed:
- print(f"Tihomir succeeded, he jumped over {starting - 5}cm after {counter} jumps.")
- else:
- print(f"Tihomir failed at {starting}cm after {counter} jumps.")
Advertisement
Add Comment
Please, Sign In to add comment