记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:13:13: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
     scanf("%d %d",year, month);
             ^
/in/foo.c:13:16: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'int' [-Wformat=]
     scanf("%d %d",year, month);
                ^
/in/foo.c:26:3: error: case label not within a switch statement
   case 5: {print_day(31);break;}
   ^~~~
/in/foo.c:26:26: error: break statement not within loop or switch
   case 5: {print_day(31);break;}
                          ^~~~~
/in/foo.c:27:3: error: case label not within a switch statement
   case 6: {print_day(30);break;}
   ^~~~
/in/foo.c:27:26: error: break statement not within loop or switch
   case 6: {print_day(30);break;}
                          ^~~~~
/in/foo.c:28:3: error: case label not within a switch statement
   case 7: {print_day(31);break;}
   ^~~~
/in/foo.c:28:26: error: break statement not within loop or switch
   case 7: {print_day(31);break;}
                          ^~~~~
/in/foo.c:29:3: error: case label not within a switch statement
   case 8: {print_day(31);break;}
   ^~~~
/in/foo.c:29:26: error: break statement not within loop or switch
   case 8: {print_day(31);break;}
                          ^~~~~
/in/foo.c:30:3: error: case label not within a switch statement
   case 9: {print_day(30);break;}
   ^~~~
/in/foo.c:30:26: error: break statement not within loop or switch
   case 9: {print_day(30);break;}
                          ^~~~~
/in/foo.c:31:3: error: case label not within a switch statement
   case 10: {print_day(31);break;}
   ^~~~
/in/foo.c:31:27: error: break statement not within loop or switch
   case 10: {print_day(31);break;}
                           ^~~~~
/in/foo.c:32:3: error: case label not within a switch statement
   case 11: {print_day(30);break;}
   ^~~~
/in/foo.c:32:27: error: break statement not within loop or switch
   case 11: {print_day(30);break;}
                           ^~~~~
/in/foo.c:33:3: error: case label not within a switch statement
   case 12: {print_day(31);break;}
   ^~~~
/in/foo.c:33:27: error: break statement not within loop or switch
   case 12: {print_day(31);break;}
                           ^~~~~
/in/foo.c:34:3: error: 'default' label not within a switch statement
   default:break;
   ^~~~~~~
/in/foo.c:34:11: error: break statement not within loop or switch
   default:break;
           ^~~~~
/in/foo.c: At top level:
/in/foo.c:36:1: error: expected identifier or '(' before '}' token
 }
 ^

信息

递交者
类型
递交
题目
A1-3 分支结构练习:月份天数
语言
C
递交时间
2021-06-30 22:08:37
评测时间
2021-06-30 22:08:37
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes