记录详情

Compile Error

/in/foo.c: In function 'Insert':
/in/foo.c:10:2: error: 'else' without a previous 'if'
  else break;
  ^~~~
/in/foo.c:10:7: error: break statement not within loop or switch
  else break;
       ^~~~~
/in/foo.c: At top level:
/in/foo.c:12:1: error: expected identifier or '(' before 'return'
 return 0;
 ^~~~~~
/in/foo.c:13:1: error: expected identifier or '(' before '}' token
 }
 ^
/in/foo.c: In function 'main':
/in/foo.c:17:2: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
  scanf("%d",&n);
  ^~~~~
/in/foo.c:17:2: warning: incompatible implicit declaration of built-in function 'scanf'
/in/foo.c:17:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
/in/foo.c:24:9: warning: passing argument 1 of 'Insert' makes pointer from integer without a cast [-Wint-conversion]
  Insert(x,a,n);
         ^
/in/foo.c:1:5: note: expected 'int *' but argument is of type 'int'
 int Insert(int a[],int n,int x)
     ^~~~~~
/in/foo.c:24:11: warning: passing argument 2 of 'Insert' makes integer from pointer without a cast [-Wint-conversion]
  Insert(x,a,n);
           ^
/in/foo.c:1:5: note: expected 'int' but argument is of type 'int *'
 int Insert(int a[],int n,int x)
     ^~~~~~
/in/foo.c:27:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   printf("%d",a[i]);
   ^~~~~~
/in/foo.c:27:3: warning: incompatible implicit declaration of built-in function 'printf'
/in/foo.c:27:3: note: include '<stdio.h>' or provide a declaration of 'printf'
/in/foo.c: In function 'Insert':
/in/foo.c:11:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
自测
题目
A7-5 数组的有序插入函数
语言
C
递交时间
2019-05-04 21:21:42
评测时间
2019-05-04 21:21:42
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes