http://acm.fzu.edu.cn/problem.php?pid=2214 Problem Description Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the items into a knapsack so that the total weight is less than or equal to a given limit B a
自己做的,没有整理代码,还是做出来了: 做这个题时,最总要的一步思路就是,先让长度一致,然后从个位开始,每一个与每一个数字相加,如果大于10,则下一次另外两个数相加时加1 function add(a, b) { var arr = a.split(""); var brr = b.split(""); var crr = []; var i; var n; var flag = false;判断两个数字相加是否大于10; var f = false;判断头两位相加