euro denominations by NikNakk

x=scan("stdin");d=c(c(5,2,1)%o%c(1e4,1e3,100,10,1));for(y in x){z=c();e=1;while(y>0){f=d[e];if(y>=f){y=y-f;z=c(z,f)}else{e=e+1}};cat(paste(z,collapse="+"),"\n",sep="")}

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

download

return to the top page