约数求和

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

def divisors(n)
  sumOfDivisors=0
  i=1
  while i<n
  if n%i==0
    divisor=i
    sumOfDivisors=sumOfDivisors+divisor
  end
  i=i+1
end
puts "The sum of divisors is "+sumOfDivisors.to_s
end