记录详情

Compile Error

/in/foo.c:3:29: error: parameter 'b' has just a forward declaration
 void cal1(int n,int a[],int b[];int j)
                             ^
/in/foo.c:3:21: error: parameter 'a' has just a forward declaration
 void cal1(int n,int a[],int b[];int j)
                     ^
/in/foo.c:3:15: error: parameter 'n' has just a forward declaration
 void cal1(int n,int a[],int b[];int j)
               ^
/in/foo.c: In function 'cal1':
/in/foo.c:4:16: error: 'n' undeclared (first use in this function)
 {for(int i=1;i<n;i++)
                ^
/in/foo.c:4:16: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:5:2: error: 'b' undeclared (first use in this function)
 {b[j]++;
  ^
/in/foo.c:6:4: error: 'a' undeclared (first use in this function)
 if(a[j+i]==1){break;}}
    ^
/in/foo.c: At top level:
/in/foo.c:9:29: error: parameter 'b' has just a forward declaration
 void cal2(int n,int a[],int b[];int j)
                             ^
/in/foo.c:9:21: error: parameter 'a' has just a forward declaration
 void cal2(int n,int a[],int b[];int j)
                     ^
/in/foo.c:9:15: error: parameter 'n' has just a forward declaration
 void cal2(int n,int a[],int b[];int j)
               ^
/in/foo.c: In function 'cal2':
/in/foo.c:10:16: error: 'n' undeclared (first use in this function)
 {for(int i=1;i<n;i++)
                ^
/in/foo.c:11:2: error: 'c' undeclared (first use in this function)
 {c[j]++;
  ^
/in/foo.c:12:4: error: 'a' undeclared (first use in this function)
 if(a[j-i]==1){break;}}
    ^
/in/foo.c: In function 'main':
/in/foo.c:25:30: error: 'j' undeclared (first use in this function)
  else if(a[i]==0){cal1(n,a,b,j);cal2(n,a,c,j);}
                              ^
/in/foo.c:25:19: error: too many arguments to function 'cal1'
  else if(a[i]==0){cal1(n,a,b,j);cal2(n,a,c,j);}
                   ^~~~
/in/foo.c:3:6: note: declared here
 void cal1(int n,int a[],int b[];int j)
      ^~~~
/in/foo.c:25:33: error: too many arguments to function 'cal2'
  else if(a[i]==0){cal1(n,a,b,j);cal2(n,a,c,j);}
                                 ^~~~
/in/foo.c:9:6: note: declared here
 void cal2(int n,int a[],int b[];int j)
      ^~~~
/in/foo.c:26:15: error: expected ')' before ']' token
  if(b[i]>=c[i]]){max[i]=b[i];}
               ^
/in/foo.c:26:15: error: expected statement before ']' token
/in/foo.c:26:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if(b[i]>=c[i]]){max[i]=b[i];}
  ^~
/in/foo.c:26:16: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
  if(b[i]>=c[i]]){max[i]=b[i];}
                ^
/in/foo.c:26:16: error: expected statement before ')' token
/in/foo.c:27:2: error: 'else' without a previous 'if'
  else{max[i]=c[i];}}
  ^~~~
/in/foo.c:28:6: error: conflicting types for 'max'
  int max=0;
      ^~~
/in/foo.c:19:21: note: previous declaration of 'max' was here
  int a[n],b[n],c[n],max[n];
                     ^~~
/in/foo.c:30:9: error: subscripted value is neither array nor pointer nor vector
  {if(max[i]>max){max=max[i];}}
         ^
/in/foo.c:30:25: error: subscripted value is neither array nor pointer nor vector
  {if(max[i]>max){max=max[i];}}
                         ^

信息

递交者
类型
自测
题目
P1482 H. Where Klee Sit
语言
C
递交时间
2023-08-25 12:22:28
评测时间
2023-08-25 12:22:28
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes