Advertisement
skb50bd

URI 1021

Mar 11th, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. li = [100.0, 50.0, 20.0, 10.0, 5.0, 2.0, 1.0, 0.5, 0.25, 0.10, 0.05, 0.01]
  2.  
  3. n = float(input())
  4. n += 0.001
  5.  
  6. print "NOTAS:"
  7.  
  8. for item in li:
  9.     c = 0
  10.     while n >= item:
  11.         n -= item
  12.         c += 1
  13.     if item == 1.0:
  14.         print "MOEDAS:"
  15.     if item >= 2.0:
  16.         print "%d nota(s) de R$ %.2f" %(c, item)
  17.     else:
  18.         print "%d moeda(s) de R$ %.2f" %(c, item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement