记录详情

Compile Error

foo.c: In function 'main':
foo.c:5:15: warning: multi-character character constant [-Wmultichar]
    5 |         scanf('&d&d',&nian,&yue)
      |               ^~~~~~
foo.c:5:23: error: 'nian' undeclared (first use in this function)
    5 |         scanf('&d&d',&nian,&yue)
      |                       ^~~~
foo.c:5:23: note: each undeclared identifier is reported only once for each function it appears in
foo.c:5:29: error: 'yue' undeclared (first use in this function)
    5 |         scanf('&d&d',&nian,&yue)
      |                             ^~~
foo.c:5:15: warning: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    5 |         scanf('&d&d',&nian,&yue)
      |               ^~~~~~
      |               |
      |               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:5:33: error: expected ';' before 'if'
    5 |         scanf('&d&d',&nian,&yue)
      |                                 ^
      |                                 ;
    6 |         if(nian%4==0)
      |         ~~                       
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A1-3 分支结构练习:月份天数
比赛
2023年新生赛(第一场)
语言
C
递交时间
2023-08-15 15:20:50
评测时间
2023-08-15 15:20:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes