记录详情

Compile Error

/in/foo.c:8:1: error: unknown type name 'Result'
 Result calculate(float scores[], int size) {
 ^~~~~~
/in/foo.c:8:1: note: use 'struct' keyword to refer to the type
/in/foo.c: In function 'calculate':
/in/foo.c:9:5: warning: statement with no effect [-Wunused-value]
     Result res;
     ^~~~~~
/in/foo.c:9:12: error: expected ';' before 'res'
     Result res;
            ^~~
/in/foo.c:10:5: error: 'res' undeclared (first use in this function)
     res.max = scores[0];
     ^~~
/in/foo.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c: In function 'main':
/in/foo.c:32:5: warning: statement with no effect [-Wunused-value]
     Result result = calculate(scores, 10);
     ^~~~~~
/in/foo.c:32:12: error: expected ';' before 'result'
     Result result = calculate(scores, 10);
            ^~~~~~
/in/foo.c:33:21: error: 'result' undeclared (first use in this function)
     printf("%.2f ", result.max);
                     ^~~~~~
/in/foo.c: In function 'calculate':
/in/foo.c:24:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
自测
语言
C
递交时间
2024-12-23 17:52:12
评测时间
2024-12-23 17:52:12
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes