Unnamed
public text v1 · immutablex=ARGV[0].to_i
def f(n);(n/2).downto(2){|i| yield i if n%i<1};end
f(x){|i|
begin; f(i){raise}; rescue; next; end
puts "#{i} is the largest prime factor of #{x}"
exit
}
x=ARGV[0].to_i
def f(n);(n/2).downto(2){|i| yield i if n%i<1};end
f(x){|i|
begin; f(i){raise}; rescue; next; end
puts "#{i} is the largest prime factor of #{x}"
exit
}