Sofya_Soloveva_

Untitled

Jul 9th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. s = input()
  2. s = s[0:(s.rfind('0'))+1]
  3. k = 0
  4. i = 0
  5. while int(s[i+1]) != 0:
  6.     if int(s[i+1]) > int(s[i]):
  7.         k += 1
  8.     i += 1
  9. print(k)
Advertisement
Add Comment
Please, Sign In to add comment