记录详情

Compile Error

foo.c: In function 'main':
foo.c:5:15: warning: multi-character character constant [-Wmultichar]
    5 |         scanf('%d',&a[3]);
      |               ^~~~
foo.c:5:21: error: 'a' undeclared (first use in this function)
    5 |         scanf('%d',&a[3]);
      |                     ^
foo.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
foo.c:5:15: warning: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    5 |         scanf('%d',&a[3]);
      |               ^~~~
      |               |
      |               int
In file included from foo.c:1:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:421:42: note: expected 'const char * restrict' but argument is of type 'int'
  421 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:7:12: warning: right-hand operand of comma expression has no effect [-Wunused-value]
    7 |     for(b=0,b<2,b++)
      |            ^
foo.c:7:20: error: expected ';' before ')' token
    7 |     for(b=0,b<2,b++)
      |                    ^
      |                    ;
foo.c:7:20: error: expected expression before ')' token
foo.c:9:24: warning: right-hand operand of comma expression has no effect [-Wunused-value]
    9 |                 for(c=0,c<2-b,c++)
      |                        ^
foo.c:9:34: error: expected ';' before ')' token
    9 |                 for(c=0,c<2-b,c++)
      |                                  ^
      |                                  ;
foo.c:9:34: error: expected expression before ')' token
foo.c:12:41: error: expected ';' before 'a'
   12 |                         {       t=a[c+1]
      |                                         ^
      |                                         ;
   13 |                                 a[c+1]=a[c]
      |                                 ~        
foo.c:6:17: warning: variable 't' set but not used [-Wunused-but-set-variable]
    6 |         int b,c,t;
      |                 ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A1-1 分支结构练习:三数排序
比赛
2023年新生赛(第一场)
语言
C
递交时间
2023-08-15 14:52:48
评测时间
2023-08-15 14:52:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes