简单的0-1背包问题,使用动态规划的算法。
#include <iostream>
#include "stdio.h"
#include "stdlib.h"
using namespace std;
int m[10][10];
int p[10];//价值
int w[10];//重量
void backpack(int n,int c)
{
for(int i=0; i<10; i
简单的0-1背包问题,使用动态规划的算法。
#include <iostream>
#include "stdio.h"
#include "stdlib.h"
using namespace std;
int m[10][10];
int p[10];//价值
int w[10];//重量
void backpack(int n,int c)
{
for(int i=0; i<10; i