Petiasla

Untitled

Mar 5th, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. price = float(input())
  2. has_paid = int(input())
  3. price = int(price*100)
  4. has_paid = has_paid*100
  5. change = has_paid - price
  6. count_coins = 0
  7.  
  8. while change > 0:
  9. count_coins += 1
  10. if change >= 200:
  11. change -= 200
  12. print((count_coins), 'x 200 stotinki')
  13. elif change >= 100:
  14. change -= 100
  15. #count_coins += 1
  16. print((count_coins), 'x 100 stotinki')
  17. elif change >= 50:
  18. change -= 50
  19. count_coins += 1
  20. print((count_coins), 'x 50 stotinki')
  21. elif change >= 20 :
  22. change -= 20
  23. #count_coins += 1
  24. print((count_coins), 'x 20 stotinki')
  25. elif change >= 5 :
  26. change -= 5
  27. #count_coins += 1
  28. print((count_coins), ' x 5 stotinki')
  29. elif change >= 2:
  30. change -= 2
  31. #count_coins += 1
  32. print((count_coins), 'x 2 stotinki')
  33. elif change >= 1:
  34. change -= 1
  35. #count_coins += 1
  36. print((count_coins), 'x 1 stotinki')
  37. elif change >= 0:
  38. break
  39.  
Advertisement
Add Comment
Please, Sign In to add comment