记录详情

Compile Error

foo.c: In function 'main':
foo.c:5:9: error: expected declaration specifiers before 'scanf'
    5 |         scanf("%f %f %f", &a, &m, &k);
      |         ^~~~~
foo.c:6:9: error: expected declaration specifiers before 'if'
    6 |         if (a > 20 * m)
      |         ^~
foo.c:10:9: error: expected declaration specifiers before 'else'
   10 |         else
      |         ^~~~
foo.c:12:9: error: expected declaration specifiers before 'printf'
   12 |         printf("%.2f", sum);
      |         ^~~~~~
foo.c:13:9: error: expected declaration specifiers before 'return'
   13 |         return 0;
      |         ^~~~~~
foo.c:14:1: error: expected declaration specifiers before '}' token
   14 | }
      | ^
foo.c:4:24: error: declaration for parameter 'sum' but no such parameter
    4 |         float a, m, k, sum;
      |                        ^~~
foo.c:4:21: error: declaration for parameter 'k' but no such parameter
    4 |         float a, m, k, sum;
      |                     ^
foo.c:4:18: error: declaration for parameter 'm' but no such parameter
    4 |         float a, m, k, sum;
      |                  ^
foo.c:4:15: error: declaration for parameter 'a' but no such parameter
    4 |         float a, m, k, sum;
      |               ^
foo.c:15: error: expected '{' at end of input
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1085 xf1-8交电费
比赛
2022年迎新赛(第二场)
语言
C
递交时间
2022-08-27 16:23:07
评测时间
2022-08-27 16:23:07
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes