Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
SERVICE

Locked divisible


dEEpEst

Recommended Posts

[HIDE-THANKS][LANGUAGE=ruby]#!/usr/bin/env ruby

 

#

# Works out what the input integer is divisible by, useful for padbuster.

#

 

@input = ARGV[0]

 

def divisible?(i)

(@input.to_i % i).zero?

end

 

([email protected]_i).each_with_index do |i|

puts "#{@input} is divisible by #{i}" if divisible?(i)

end[/LANGUAGE][/HIDE-THANKS]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.