Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- target = int(input())
- bar_height = target - 30
- jump_height = int(input())
- success_count = 1
- fail_count = 0
- total_fail_count = 0
- while bar_height <= target: # това беше твоя код ---> while bar_height < target:
- if bar_height == target and jump_height > target: # този ред аз го дописах
- break # този ред аз го дописах
- if jump_height > bar_height:
- success_count += 1
- fail_count = 0
- bar_height += 5
- else:
- fail_count += 1
- total_fail_count += 1
- total_jumps = success_count + total_fail_count
- if fail_count == 3:
- print(f"Tihomir failed at {bar_height}cm after {total_jumps - 1} jumps.")
- break
- jump_height = int(input())
- total_jumps = success_count + total_fail_count
- if fail_count < 3:
- print(f"Tihomir succeeded, he jumped over {bar_height}cm after {total_jumps} jumps.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement