euro denominations by flow

import sys
for l in sys.stdin:
\x09g=[]
\x09z=int(l)
\x09for m in [50000,20000,10000,5000,2000,1000,500,200,100,50,20,10,5,2,1]:
\x09\x09f=int(z/m)
\x09\x09z-=f*m
\x09\x09g+=[str(m)]*f
\x09print("+".join(g))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page