BbJLeB

Untitled

Apr 18th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. import math
  2.  
  3. fantasy_price = 14.90
  4. horor_price = 9.80
  5. romance_price = 4.30
  6.  
  7. wish_money = float(input())
  8. fantasy_peace = int(input())
  9. horor_peace = int(input())
  10. romance_peace = int(input())
  11.  
  12.  
  13. fantasy = fantasy_peace * fantasy_price  # сума от фентъзи книги
  14. horor = horor_peace * horor_price        # сума от хорор книги
  15. romance = romance_peace * romance_price  # сума от романтични книи
  16. win_money = fantasy + horor + romance    # цената на всички книги
  17. moneyDDS = win_money * 0.20              # цената без ДДС
  18. money1 = win_money - moneyDDS            # чиста сума без ДДС
  19. money = money1 - wish_money              # сумата НАД парите решени за дарение
  20. for_seller = moneyDDS * 0.1              # парите за продавачите
  21. clean_money = moneyDDS - for_seller      # парите в плюс над тези за дарение
  22. donate = clean_money + wish_money        # общо пари за дарение
  23. maybe = wish_money - money1              # колко пари недостига
  24.  
  25. if money1 > wish_money:
  26.     print (f"{(donate):.2f} leva donated.")
  27.     print(f"Sellers will receive {math.floor(for_seller)}  leva.")
  28. else:
  29.     print (f"{(maybe):.2f} money needed")
Advertisement
Add Comment
Please, Sign In to add comment