记录详情

Compile Error

foo.c: In function 'main':
foo.c:7:15: warning: missing terminating " character
    7 |         scanf("%d%d,&year,&month);
      |               ^
foo.c:7:15: error: missing terminating " character
    7 |         scanf("%d%d,&year,&month);
      |               ^~~~~~~~~~~~~~~~~~~~
foo.c:9:62: error: expected ')' before ';' token
    9 |                   printf("year = %d,month = %d\n",year,month);
      |                                                              ^
      |                                                              )
foo.c:7:14: note: to match this '('
    7 |         scanf("%d%d,&year,&month);
      |              ^
foo.c:9:19: warning: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    9 |                   printf("year = %d,month = %d\n",year,month);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   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:30:19: error: expected declaration or statement at end of input
   30 |                   }
      |                   ^
foo.c:4:24: warning: unused variable 'day' [-Wunused-variable]
    4 |         int year,month,day;
      |                        ^~~
[Hydro](https://hydro.ac)提供评测服务

信息

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