Sichanov

profit

Dec 24th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. one_lv_coin = int(input())
  2. two_lv_coin = int(input())
  3. five_lv_bill = int(input())
  4. amount = int(input())
  5.  
  6. for a in range(0, one_lv_coin+1):
  7.     for b in range(0, two_lv_coin+1):
  8.         for c in range(0, five_lv_bill+1):
  9.             if a*1 + b*2 + c*5 == amount:
  10.                 print(f"{a} * 1 lv. + {b} * 2 lv. + {c} * 5 lv. = {amount} lv.")
  11.  
Advertisement
Add Comment
Please, Sign In to add comment