Created
March 3, 2011 02:53
-
-
Save nerdyworm/852233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
over_paid = 53 | |
change = [] | |
[100, 25, 10, 5, 1].each do |i| | |
while i <= over_paid do | |
if i <= over_paid | |
over_paid -= i | |
change << i | |
end | |
end | |
end | |
puts change |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment