记录详情

Compile Error

foo.c:8:5: error: redefinition of 'main'
    8 | int main()
      |     ^~~~
foo.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main()
      |     ^~~~
foo.c: In function 'main':
foo.c:10:22: error: conflicting types for 'i'; have 'int[3]'
   10 |         int i,j,k=0, i[3]={0};
      |                      ^
foo.c:10:13: note: previous declaration of 'i' with type 'int'
   10 |         int i,j,k=0, i[3]={0};
      |             ^
foo.c:11:14: error: 'a' undeclared (first use in this function)
   11 |         for (a=0;i<3;i++)
      |              ^
foo.c:11:14: note: each undeclared identifier is reported only once for each function it appears in
foo.c:25:24: warning: missing terminating " character
   25 |                 printf("%d,a[j]);
      |                        ^
foo.c:25:24: error: missing terminating " character
   25 |                 printf("%d,a[j]);
      |                        ^~~~~~~~~~
foo.c:26:21: error: expected ')' before ';' token
   26 |         printf("\n");
      |                     ^
      |                     )
foo.c:25:23: note: to match this '('
   25 |                 printf("%d,a[j]);
      |                       ^
foo.c:26:9: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   26 |         printf("\n");
      |         ^~~~~~~~~~~~
      |         |
      |         int
In file included from foo.c:1:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:356:43: note: expected 'const char * restrict' but argument is of type 'int'
  356 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:27:17: error: expected ';' before '}' token
   27 |         return 0
      |                 ^
      |                 ;
   28 | }
      | ~                
foo.c:10:22: warning: unused variable 'i' [-Wunused-variable]
   10 |         int i,j,k=0, i[3]={0};
      |                      ^
[Hydro](https://hydro.ac)提供评测服务

信息

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