Compile Error

/in/foo.c: In function 'main':
/in/foo.c:26:2: error: variable-sized object may not be initialized
  int weightList[n] = {0};
  ^~~
/in/foo.c:26:23: warning: excess elements in array initializer
  int weightList[n] = {0};
                       ^
/in/foo.c:26:23: note: (near initialization for 'weightList')
/in/foo.c:27:2: error: variable-sized object may not be initialized
  int  valueList[n] = {0};
  ^~~
/in/foo.c:27:23: warning: excess elements in array initializer
  int  valueList[n] = {0};
                       ^
/in/foo.c:27:23: note: (near initialization for 'valueList')

信息

递交者
类型
递交
题目
【新手练习】01背包
语言
C
递交时间
2019-03-20 23:49:27
评测时间
2019-03-20 23:49:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes