RosettaCodeData/Task/Count-the-coins/Run-BASIC/count-the-coins.run
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

13 lines
398 B
Text

for penny = 0 to 100
for nickel = 0 to 20
for dime = 0 to 10
for quarter = 0 to 4
if penny + nickel * 5 + dime * 10 + quarter * 25 = 100 then
print penny;" pennies ";nickel;" nickels "; dime;" dimes ";quarter;" quarters"
count = count + 1
end if
next quarter
next dime
next nickel
next penny
print count;" ways to make a buck"