记录详情

Compile Error

foo.c: In function 'main':
foo.c:6:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'printf'
    6 |         printf("输入年份及月份");
      |         ^~~~~~
foo.c:7:9: warning: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d%d",&year,&month);
      |         ^~~~~~~
      |         scanf
foo.c:7:31: error: 'month' undeclared (first use in this function)
    7 |         scanf_s("%d%d",&year,&month);
      |                               ^~~~~
foo.c:7:31: note: each undeclared identifier is reported only once for each function it appears in
foo.c:37:17: warning: label 'case12' defined but not used [-Wunused-label]
   37 |                 case12:printf("31");
      |                 ^~~~~~
foo.c:35:17: warning: label 'case11' defined but not used [-Wunused-label]
   35 |                 case11:printf("30");
      |                 ^~~~~~
foo.c:33:17: warning: label 'case10' defined but not used [-Wunused-label]
   33 |                 case10:printf("31");
      |                 ^~~~~~
foo.c:31:17: warning: label 'case9' defined but not used [-Wunused-label]
   31 |                 case9:printf("30");
      |                 ^~~~~
foo.c:29:17: warning: label 'case8' defined but not used [-Wunused-label]
   29 |                 case8:printf("31");
      |                 ^~~~~
foo.c:27:17: warning: label 'case7' defined but not used [-Wunused-label]
   27 |                 case7:printf("31");
      |                 ^~~~~
foo.c:25:17: warning: label 'case6' defined but not used [-Wunused-label]
   25 |                 case6:printf("30");
      |                 ^~~~~
foo.c:23:17: warning: label 'case5' defined but not used [-Wunused-label]
   23 |                 case5:printf("31");
      |                 ^~~~~
foo.c:21:17: warning: label 'case4' defined but not used [-Wunused-label]
   21 |                 case4:printf("30");
      |                 ^~~~~
foo.c:19:17: warning: label 'case3' defined but not used [-Wunused-label]
   19 |                 case3:printf("31");
      |                 ^~~~~
foo.c:13:17: warning: label 'case2' defined but not used [-Wunused-label]
   13 |                 case2:if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
      |                 ^~~~~
foo.c:11:17: warning: label 'case1' defined but not used [-Wunused-label]
   11 |                 case1:printf("31");
      |                 ^~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

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