SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input("Enter summ: "))
  2. if n%10 != 0:
  3.     print(-1)
  4.     exit()
  5.  
  6. k = (500,200,100,50,20,10)
  7. i = 0
  8. x = 0
  9. while n > 0:
  10.     x += n // k[i]
  11.     n = n % k[i]
  12.     i+=1
  13.  
  14. print(x)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top