All pastes #776141 Raw Edit

Unnamed

public ruby v1 · immutable
·published 2007-11-15 21:55 UTC
rendered paste body
def f(n)  (n/2).downto(2){|i| yield i if n%i<1}endf(ARGV[0].to_i){|i|  begin; f(i){raise}; rescue; next; end  puts "#{i} is the largest prime factor of #{ARGV[0]}"  exit 0}