diff options
Diffstat (limited to 'challenge-003/abigail/ruby/ch-1.rb')
| -rw-r--r-- | challenge-003/abigail/ruby/ch-1.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/challenge-003/abigail/ruby/ch-1.rb b/challenge-003/abigail/ruby/ch-1.rb new file mode 100644 index 0000000000..c0a22397b0 --- /dev/null +++ b/challenge-003/abigail/ruby/ch-1.rb @@ -0,0 +1,26 @@ +#!/usr/bin/ruby + +# +# See ../README.md +# + +# +# Run as: ruby ch-1.rb < input-file +# + +ARGF . each_line do |_| + max = _ . to_i + base2 = 1 + while base2 <= max + base3 = base2 + while base3 <= max + base5 = base3 + while base5 <= max + puts base5 + base5 *= 5 + end + base3 *= 3 + end + base2 *= 2 + end +end |
