编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#103603 | #105. zxh的继承顺位 | Compile Error | 0 | 0 ms | 0 K | C / 412 B | 安然 | 2024-03-21 23:24:04 |
#include <stdio.h>
#define MaxSize 10000
typedef struct {
int data[10000];
int length;
} SqList;
void InitList(SqList &L) {
for (int i = 0; i < MaxSize; i++) L.data[i] = 0;
L.length = 0;
}
int mian() {
int n;
SqList L;
for (int k = 1; k < 10000; k++) {
if (k % 2 != 0 && k % 3 != 0 && k % 5 != 0) {
InitList(k);
}
}
scanf("%d", &n);
printf("%d", data[n]);
}
编译信息
/sandbox/1/a.c:8:22: error: expected ')'
void InitList(SqList &L){
^
/sandbox/1/a.c:8:14: note: to match this '('
void InitList(SqList &L){
^
/sandbox/1/a.c:8:22: warning: omitting the parameter name in a function definition is a C2x extension [-Wc2x-extensions]
void InitList(SqList &L){
^
/sandbox/1/a.c:10:5: error: use of undeclared identifier 'L'
L.data[i]=0;
^
/sandbox/1/a.c:11:5: error: use of undeclared identifier 'L'
L.length=0;
^
/sandbox/1/a.c:19:22: error: passing 'int' to parameter of incompatible type 'SqList'
InitList(k);
^
/sandbox/1/a.c:8:22: note: passing argument to parameter here
void InitList(SqList &L){
^
/sandbox/1/a.c:23:17: error: use of undeclared identifier 'data'
printf("%d",data[n]);
^
1 warning and 5 errors generated.