记录详情

Compile Error

foo.c: In function 'main':
foo.c:7:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    7 | if (b=0),{return 1};
      |     ^
foo.c:7:9: error: expected expression before ',' token
    7 | if (b=0),{return 1};
      |         ^
foo.c:7:9: warning: left-hand operand of comma expression has no effect [-Wunused-value]
foo.c:8:30: error: expected ';' before '}' token
    8 | else {return a*chengji(a,b-1)
      |                              ^
      |                              ;
    9 | };
      | ~                             
foo.c:12:12: error: 'i' undeclared (first use in this function)
   12 | sum=sum*(a[i]-0)*chengji(2,19-i);
      |            ^
foo.c:12:12: note: each undeclared identifier is reported only once for each function it appears in
foo.c:13:6: error: conflicting types for 'a'; have 'char[20]'
   13 | char a[20]={0};
      |      ^
foo.c:4:9: note: previous declaration of 'a' with type 'int'
    4 | int m,n,a,b;
      |         ^
foo.c:14:18: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
   14 |         printf("%s",n);
      |                 ~^  ~
      |                  |  |
      |                  |  int
      |                  char *
      |                 %d
foo.c:15:9: warning: 'gets' is deprecated [-Wdeprecated-declarations]
   15 |         gets-s(a.20);
      |         ^~~~
In file included from foo.c:1:
/nix/store/1x86jfiwsp5qi448fcdkkzn7vmx4krv2-glibc-2.35-163-dev/include/stdio.h:605:14: note: declared here
  605 | extern char *gets (char *__s) __wur __attribute_deprecated__;
      |              ^~~~
foo.c:15:14: warning: implicit declaration of function 's' [-Wimplicit-function-declaration]
   15 |         gets-s(a.20);
      |              ^
foo.c:15:17: error: expected ')' before numeric constant
   15 |         gets-s(a.20);
      |               ~ ^~~
      |                 )
foo.c:15:13: warning: value computed is not used [-Wunused-value]
   15 |         gets-s(a.20);
      |         ~~~~^~~~~~~~
foo.c:4:5: warning: unused variable 'm' [-Wunused-variable]
    4 | int m,n,a,b;
      |     ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1081 xf1-4进制转换2
比赛
2022年迎新赛(第二场)
语言
C
递交时间
2022-08-27 15:56:12
评测时间
2022-08-27 16:02:16
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes