class Array; def sum; inject( nil ) { |sum,x| sum ? sum+x : x }; end; end def clonearray(arr) b = [] for a in arr b << a end return b end def match(condidatesolution,avail,paymoney) @temp = 0 for i in 0..avail.size-1 @temp += condidatesolution[i] * avail[i] end retur ...
  • 23:12
  • 浏览 (27)
  • 评论 (0)
1000copy
搜索本博客
博客分类
最近加入圈子
最新评论