记录详情

Compile Error

/in/foo.c: In function 'FindMaxs':
/in/foo.c:5:16: error: 'n' undeclared (first use in this function)
  for(int i=1;i<n;i++)
                ^
/in/foo.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:6:6: error: 'a' undeclared (first use in this function)
   if(a[i]<a[max])
      ^
/in/foo.c: At top level:
/in/foo.c:10:6: warning: return type of 'main' is not 'int' [-Wmain]
 void main()
      ^~~~
/in/foo.c: In function 'main':
/in/foo.c:14:7: error: conflicting types for 'a'
  int *a,*b;
       ^
/in/foo.c:12:6: note: previous declaration of 'a' was here
  int a,b;
      ^
/in/foo.c:14:10: error: conflicting types for 'b'
  int *a,*b;
          ^
/in/foo.c:12:8: note: previous declaration of 'b' was here
  int a,b;
        ^
/in/foo.c:16:4: error: 'new' undeclared (first use in this function)
  a=new int[size];
    ^~~
/in/foo.c:16:8: error: expected ';' before 'int'
  a=new int[size];
        ^~~
/in/foo.c:17:8: error: expected ';' before 'int'
  b=new int[size];
        ^~~
/in/foo.c:18:2: error: 'delete' undeclared (first use in this function)
  delete []a;
  ^~~~~~
/in/foo.c:18:10: error: expected expression before ']' token
  delete []a;
          ^
/in/foo.c:19:10: error: expected expression before ']' token
  delete []b;
          ^
/in/foo.c:20:11: warning: passing argument 1 of 'FindMaxs' makes integer from pointer without a cast [-Wint-conversion]
  FindMaxs(a);
           ^
/in/foo.c:2:5: note: expected 'int' but argument is of type 'int *'
 int FindMaxs(int x)
     ^~~~~~~~
/in/foo.c:21:11: warning: passing argument 1 of 'FindMaxs' makes integer from pointer without a cast [-Wint-conversion]
  FindMaxs(b);
           ^
/in/foo.c:2:5: note: expected 'int' but argument is of type 'int *'
 int FindMaxs(int x)
     ^~~~~~~~
/in/foo.c:15:6: warning: unused variable 'size' [-Wunused-variable]
  int size=100;
      ^~~~
/in/foo.c:13:9: warning: unused variable 'n2' [-Wunused-variable]
  int n1,n2;
         ^~
/in/foo.c:13:6: warning: unused variable 'n1' [-Wunused-variable]
  int n1,n2;
      ^~

信息

递交者
类型
自测
题目
A9-7 数组中所有极大值
语言
C
递交时间
2019-09-16 10:29:01
评测时间
2019-09-16 10:29:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes