Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. numbers = int(input())
  2. nots = 0
  3. jumps = 0
  4. jump_practice = 0
  5. num = numbers
  6. start_high = numbers - 30
  7.  
  8. while num >= start_high:
  9.     jump_practice = int(input())
  10.     jumps += 1
  11.     if jump_practice > start_high:
  12.         if jump_practice >= num:
  13.             break
  14.         start_high += 5
  15.         nots = 0
  16.     elif jump_practice <= start_high:
  17.          nots += 1
  18.     if nots == 3:
  19.         print(f'Tihomir failed at {start_high}cm after {jumps} jumps.')
  20.         break
  21. if jump_practice >= numbers:
  22.     print(f'Tihomir succeeded, he jumped over {start_high}cm after {jumps} jumps.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement