Advertisement
Spocoman

07. Flower Shop

Dec 18th, 2021
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import math
  2.  
  3. magnolia = int(input())
  4. hyacinth = int(input())
  5. rose = int(input())
  6. cactus = int(input())
  7. gift = float(input())
  8.  
  9. total = (magnolia * 3.25 + hyacinth * 4 + rose * 3.5 + cactus * 8) * 0.95
  10.  
  11. if total >= gift:
  12.     print(f'She is left with {math.floor(total - gift)} leva.')
  13. else:
  14.     print(f'She will have to borrow {math.ceil(gift - total)} leva.')
  15.  
  16.  
  17.  
  18. Taрикатско решение:)
  19.  
  20. import math
  21.  
  22. total = (int(input()) * 3.25 + int(input()) * 4 + int(input()) * 3.5 + int(input()) * 8) * 0.95
  23.  
  24. if total >= float(input()):
  25.     print(f'She is left with {math.floor(total - float(input()))} leva.')
  26. else:
  27.     print(f'She will have to borrow {math.ceil(float(input()) - total)} leva.')
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement