Defficient Number

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

def defficient(n)
  sumOfFactors=0
  
  for i in 1..n
    if n%i==0
      factor=i
      sumOfFactors += factor
    end
  end
  
    
  if sumOfFactors<2*n
    puts "The given number is a deficient number"
      
  else
    puts "It's not a deficient number"
  end
end