记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:6:6: error: expected expression before ':' token
  std::cin>>year>>month;
      ^
/in/foo.c:10:30: error: expected ')' before '!' token
    if ((year%4==0 && year%100!+0) || year%400==0)){
                              ^
/in/foo.c:10:50: error: expected statement before ')' token
    if ((year%4==0 && year%100!+0) || year%400==0)){
                                                  ^
/in/foo.c:10:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    if ((year%4==0 && year%100!+0) || year%400==0)){
    ^~
/in/foo.c:10:51: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
    if ((year%4==0 && year%100!+0) || year%400==0)){
                                                   ^
/in/foo.c:13:4: error: 'else' without a previous 'if'
    else {
    ^~~~
/in/foo.c:15:4: error: expected ';' before '}' token
    }
    ^
/in/foo.c:25:5: error: expected ';' before '}' token
     }
     ^
/in/foo.c:26:2: error: duplicate label 'std'
  std::cout<<days<<std::endl;
  ^~~
/in/foo.c:6:2: note: previous definition of 'std' was here
  std::cin>>year>>month;
  ^~~
/in/foo.c:26:6: error: expected expression before ':' token
  std::cout<<days<<std::endl;
      ^
/in/foo.c:7:6: warning: variable 'days' set but not used [-Wunused-but-set-variable]
  int days;
      ^~~~
/in/foo.c:6:2: warning: label 'std' defined but not used [-Wunused-label]
  std::cin>>year>>month;
  ^~~

信息

递交者
类型
自测
题目
A1-3 分支结构练习:月份天数
语言
C
递交时间
2024-08-17 17:48:02
评测时间
2024-08-17 17:48:02
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes