编辑代码

#include <stdio.h>
#include <stdlib.h>

typedef struct {
    char name[20];
    int weight;
    int value;
} Item;

int dynamicBackpack(Item item[], int len, int capacity) {
    //1.构建动态规划需要的二维数组来存储子问题的结果

    //2.利用公式填充二维数组

    //3.放回最终的结果

    return 0;
}

int main () {
    Item items[] = {
        "吉他", 1, 1500,
        "笔记本电脑", 3, 2000,
        "音响", 4, 3000
    };
    
    return 0;
}