QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#350387 | #7933. Build Permutation | MaMengQi | Compile Error | / | / | C99 | 1.1kb | 2024-03-10 18:06:14 | 2024-03-10 18:06:14 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
詳細信息
answer.code: In function ‘solve’: answer.code:4:21: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration] 4 | int* re = (int*)malloc(sizeof(int)*length); | ^~~~~~ answer.code:4:21: warning: incompatible implicit declaration of built-in function ‘malloc’ answer.code:2:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’ 1 | #include<stdio.h> +++ |+#include <stdlib.h> 2 | int* solve(int length, int* array) answer.code:42:20: warning: returning ‘int’ from a function with return type ‘int *’ makes pointer from integer without a cast [-Wint-conversion] 42 | return -1; | ^ answer.code: In function ‘main’: answer.code:53:9: error: ‘i’ undeclared (first use in this function) 53 | for(i=0; i<n; i++){ | ^ answer.code:53:9: note: each undeclared identifier is reported only once for each function it appears in answer.code:55:5: error: variable-sized object may not be initialized 55 | int b[n] = solve(n,a) | ^~~ answer.code:56:5: error: expected ‘,’ or ‘;’ before ‘for’ 56 | for(i=0; i<n; i++){ | ^~~ answer.code:56:22: error: expected ‘;’ before ‘)’ token 56 | for(i=0; i<n; i++){ | ^ | ; answer.code:56:22: error: expected statement before ‘)’ token answer.code:58:1: error: expected declaration or statement at end of input 58 | } | ^ answer.code:58:1: error: expected declaration or statement at end of input answer.code:51:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] 51 | scanf("%d", &n); | ^~~~~~~~~~~~~~~