记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:10:28: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   10 |                         if(a%400==0)
      |                            ^
foo.cc:10:35: error: unable to find numeric literal operator ‘operator"")’
   10 |                         if(a%400==0)
      |                                   ^~~
foo.cc:10:35: note: use ‘-fext-numeric-literals’ to enable more built-in suffixes
foo.cc:12:25: error: expected primary-expression before ‘else’
   12 |                         else
      |                         ^~~~
foo.cc:11:32: error: expected ‘)’ before ‘else’
   11 |                            c=1;
      |                                ^
      |                                )
   12 |                         else
      |                         ~~~~    
foo.cc:10:27: note: to match this ‘(’
   10 |                         if(a%400==0)
      |                           ^
foo.cc:8:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
    8 |         if(a%4==0)
      |           ^
foo.cc:19:15: error: expected primary-expression before ‘;’ token
   19 |     cin>>day>>;
      |               ^
foo.cc:23:36: warning: left operand of comma operator has no effect [-Wunused-value]
   23 |                                if(b==4,6,9,11)
      |                                   ~^~~
foo.cc:23:42: warning: right operand of comma operator has no effect [-Wunused-value]
   23 |                                if(b==4,6,9,11)
      |                                          ^
foo.cc:23:44: warning: right operand of comma operator has no effect [-Wunused-value]
   23 |                                if(b==4,6,9,11)
      |                                            ^~
foo.cc:24:39: error: expected ‘;’ before ‘else’
   24 |                                 day=30
      |                                       ^
      |                                       ;
   25 |                                else
      |                                ~~~~    
foo.cc:28:37: error: expected ‘}’ at end of input
   28 |                            return 0;
      |                                     ^
foo.cc:4:1: note: to match this ‘{’
    4 | {
      | ^

信息

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