背包问题:求小于M并且加起来和等于N的数 int N, M;void output(int a[]){ for (int i = M; i >=1; i--) { if (1 == a[i]) cout << i << " "; } cout << endl;}void backpack(int a[], int n, int m){ if (n < 1 || m < 1 || ( c/c++ 2023-11-20 55 点赞 0 评论 83 浏览