记录详情

Compile Error

/in/foo.c: In function 'Search':
/in/foo.c:5:6: error: 'j' undeclared (first use in this function)
 for (j=0,j<n,j++)
      ^
/in/foo.c:5:6: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:5:12: error: 'n' undeclared (first use in this function)
 for (j=0,j<n,j++)
            ^
/in/foo.c:5:9: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for (j=0,j<n,j++)
         ^
/in/foo.c:5:13: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 for (j=0,j<n,j++)
             ^
/in/foo.c:5:17: error: expected ';' before ')' token
 for (j=0,j<n,j++)
                 ^
/in/foo.c:5:17: error: expected expression before ')' token
/in/foo.c:7:7: error: 'a' undeclared (first use in this function)
   if (a[j]==i)
       ^
/in/foo.c:10:2: error: 'retun' undeclared (first use in this function)
  retun -1;
  ^~~~~
/in/foo.c: In function 'main':
/in/foo.c:15:7: error: stray '\357' in program
  int m;
       ^
/in/foo.c:15:8: error: stray '\274' in program
  int m;
        ^
/in/foo.c:15:9: error: stray '\233' in program
  int m;
         ^
/in/foo.c:16:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'printf'
     printf("请输入n个整数(n<10000)\n");
     ^~~~~~
/in/foo.c:18:3: warning: 'return' with no value, in function returning non-void
   return;
   ^~~~~~
/in/foo.c:12:5: note: declared here
 int main()
     ^~~~
/in/foo.c:19:10: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
  scanf("%d",n);
          ^
/in/foo.c:21:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
  for (int i=0,i<n,i++)
                ^
/in/foo.c:27:13: error: 'm' undeclared (first use in this function)
  scanf("%d",m);
             ^
/in/foo.c:27:15: error: expected ')' before ';' token
  scanf("%d",m);
               ^
/in/foo.c:30:1: error: expected expression before '}' token
 }
 ^
/in/foo.c:21:11: warning: unused variable 'i' [-Wunused-variable]
  for (int i=0,i<n,i++)
           ^
/in/foo.c:20:6: warning: unused variable 'a' [-Wunused-variable]
  int a[n];
      ^
/in/foo.c: In function 'Search':
/in/foo.c:11:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
自测
题目
A7-4 数组的查找函数
语言
C
递交时间
2019-09-09 10:52:25
评测时间
2019-09-09 10:52:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes