记录详情

Compile Error

foo.c: In function 'judge':
foo.c:2:6: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
    2 |  int judge (n)
      |      ^~~~~
foo.c:3:7: error: 'm' undeclared (first use in this function)
    3 |  {for(m=2,n=n,o=0;m<n;m++)
      |       ^
foo.c:3:7: note: each undeclared identifier is reported only once for each function it appears in
foo.c:3:10: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    3 |  {for(m=2,n=n,o=0;m<n;m++)
      |          ^
foo.c:3:15: error: 'o' undeclared (first use in this function)
    3 |  {for(m=2,n=n,o=0;m<n;m++)
      |               ^
foo.c:10:7: error: expected expression before 'return'
   10 |  o==0?return 0:return 1;
      |       ^~~~~~
foo.c: At top level:
foo.c:15:2: error: expected identifier or '(' before '{' token
   15 |  {for(m=2,n=n,o=0;m<n;m++)
      |  ^
foo.c: In function 'main':
foo.c:28:14: error: 'a' undeclared (first use in this function)
   28 |  scanf("%d",&a);
      |              ^
foo.c:29:10: error: 'x' undeclared (first use in this function)
   29 |  for(a=a,x=a,y=0;x>=y;y++,x--)
      |          ^
foo.c:29:9: warning: left-hand operand of comma expression has no effect [-Wunused-value]
   29 |  for(a=a,x=a,y=0;x>=y;y++,x--)
      |         ^
foo.c:29:14: error: 'y' undeclared (first use in this function)
   29 |  for(a=a,x=a,y=0;x>=y;y++,x--)
      |              ^
foo.c:29:13: warning: left-hand operand of comma expression has no effect [-Wunused-value]
   29 |  for(a=a,x=a,y=0;x>=y;y++,x--)
      |             ^
foo.c:29:26: warning: left-hand operand of comma expression has no effect [-Wunused-value]
   29 |  for(a=a,x=a,y=0;x>=y;y++,x--)
      |                          ^
foo.c:30:47: error: expected ')' before ';' token
   30 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";y,x,a):a ;
      |                                    ~          ^
      |                                               )
foo.c:30:39: warning: format '%d' expects a matching 'int' argument [-Wformat=]
   30 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";y,x,a):a ;
      |                                      ~^
      |                                       |
      |                                       int
foo.c:30:42: warning: format '%d' expects a matching 'int' argument [-Wformat=]
   30 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";y,x,a):a ;
      |                                         ~^
      |                                          |
      |                                          int
foo.c:30:45: warning: format '%d' expects a matching 'int' argument [-Wformat=]
   30 |  {(judge(x)==0&&judge(y)==0)?printf("%d+%d=%d";y,x,a):a ;
      |                                            ~^
      |                                             |
      |                                             int
foo.c: In function 'judge':
foo.c:13:3: warning: control reaches end of non-void function [-Wreturn-type]
   13 |   }
      |   ^
[Hydro](https://hydro.ac)提供评测服务

信息

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