Advertisement
Petiasla

Untitled

Mar 5th, 2022
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. price = float(input())
  2. had_paid = int(input())
  3. price = int(price*100)
  4. had_paid = int(had_paid * 100)
  5.  
  6. change = had_paid - price
  7. count = 0
  8.  
  9. count += change // 50
  10. change % 50
  11. #print((count), 'x 50 stotinka')
  12. count += change //20
  13. change %= 20
  14. #print((count), 'x 20 stotinka')
  15. count += change //10
  16. change %= 10
  17. #print((count), 'x 10 stotinka')
  18. count += change //5
  19. change %= 5
  20. #print((count), 'x 5 stotinka')
  21. count += change //2
  22. change %= 2
  23. #print((count), 'x 1 stotinka')
  24. count += change //1
  25. change %= 1
  26. #print((count), 'x 1 stotinka')
  27. print(count)
  28.  
Advertisement
RAW Paste Data Copied
Advertisement