记录详情

Compile Error

foo.c: In function 'main':
foo.c:4:10: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
    4 |  scanf("%d",a);
      |         ~^  ~
      |          |  |
      |          |  int
      |          int *
foo.c:5:7: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    5 |  for(a,x=a,y=0,b>=c;b++,c--)
      |       ^
foo.c:5:16: error: 'b' undeclared (first use in this function)
    5 |  for(a,x=a,y=0,b>=c;b++,c--)
      |                ^
foo.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
foo.c:5:19: error: 'c' undeclared (first use in this function)
    5 |  for(a,x=a,y=0,b>=c;b++,c--)
      |                   ^
foo.c:5:24: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    5 |  for(a,x=a,y=0,b>=c;b++,c--)
      |                        ^
foo.c:5:28: error: expected ';' before ')' token
    5 |  for(a,x=a,y=0,b>=c;b++,c--)
      |                            ^
      |                            ;
foo.c:6:4: warning: implicit declaration of function 'judge' [-Wimplicit-function-declaration]
    6 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";c,b,a): ;
      |    ^~~~~
foo.c:6:47: error: expected ')' before ';' token
    6 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";c,b,a): ;
      |                                    ~          ^
      |                                               )
foo.c:6:39: warning: format '%d' expects a matching 'int' argument [-Wformat=]
    6 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";c,b,a): ;
      |                                      ~^
      |                                       |
      |                                       int
foo.c:6:42: warning: format '%d' expects a matching 'int' argument [-Wformat=]
    6 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";c,b,a): ;
      |                                         ~^
      |                                          |
      |                                          int
foo.c:6:45: warning: format '%d' expects a matching 'int' argument [-Wformat=]
    6 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";c,b,a): ;
      |                                            ~^
      |                                             |
      |                                             int
foo.c:6:56: error: expected expression before ';' token
    6 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";c,b,a): ;
      |                                                        ^
foo.c: In function 'judge':
foo.c:15:10: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   15 |  {for(m=2,n,o;m<n;m++)
      |          ^
foo.c:15:12: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   15 |  {for(m=2,n,o;m<n;m++)
      |            ^
foo.c:22:7: error: expected expression before 'return'
   22 |  o==0?return 0:return 1;
      |       ^~~~~~
foo.c:25:3: warning: no return statement in function returning non-void [-Wreturn-type]
   25 |   }
      |   ^
foo.c: In function 'main':
foo.c:3:22: warning: unused variable 'n' [-Wunused-variable]
    3 | {int a=0,x=0,y=0,m=0,n=0,o=0;
      |                      ^
foo.c: At top level:
foo.c:14:6: warning: 'judge' defined but not used [-Wunused-function]
   14 |  int judge(int n)
      |      ^~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A3-4 素数专题:验证哥德巴赫猜想
语言
C
递交时间
2023-10-01 09:01:43
评测时间
2023-10-01 09:01:43
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes