Advertisement
bl00dt3ars

10. Profit

Nov 13th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. coin1 = int(input())
  2. coin2 = int(input())
  3. note5 = int(input())
  4. amount = int(input())
  5.  
  6. for c1 in range(0, coin1 + 1):
  7.     for c2 in range(0, coin2 + 1):
  8.         for n5 in range(0, note5 + 1):
  9.             if amount == (n5 * 5 + c2 * 2 + c1 * 1):
  10.                 print(f'{c1} * 1 lv. + {c2} * 2 lv. + {n5} * 5 lv. = {amount} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement