home *** CD-ROM | disk | FTP | other *** search
- 0 rem << cd26-1c >>
- 1 rem commodare #22-1 :
- 2 rem making change
- 3 rem solution by b. zidovec
- 4 rem
- 10 input"amount $";a:a=a*100:input"# of coins";c:print:print" q d n p":print
- 20 forq=0toa/25:ford=0toa/10:forn=0toa/5:forp=0toa:ifq+d+n+p<>cthen40
- 30 if 25*q+10*d+5*n+p=a then printq;d;n;p:f=1
- 40 next p,n,d,q:if f=0 then print"no solution"
-