Advertisement
webbersof

Untitled

Dec 6th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. change_money = int(float(input()) * 100)
  2. number_of_coins = 0
  3.  
  4. while change_money > 0:
  5.  
  6.     number_of_coins += 1
  7.  
  8.     if change_money >= 200:
  9.         change_money -= 200
  10.  
  11.     elif change_money >= 100:
  12.         change_money -= 100
  13.  
  14.     elif change_money >= 50:
  15.         change_money -= 50
  16.  
  17.     elif change_money >= 20:
  18.         change_money -= 20
  19.  
  20.     elif change_money >= 10:
  21.         change_money -= 10
  22.  
  23.     elif change_money >= 5:
  24.         change_money -= 5
  25.  
  26.     elif change_money >= 2:
  27.         change_money -= 2
  28.  
  29.     elif change_money >= 1:
  30.         change_money -= 1
  31.  
  32. print(number_of_coins)
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement