Compile Error

foo.cc:2:1: error: '::main' must return 'int'
    2 | void main()
      | ^~~~
foo.cc: In function 'int date(int, int, int)':
foo.cc:16:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   16 | if(r=1)
      |    ~^~
foo.cc:20:1: error: 'else' without a previous 'if'
   20 | else if(month<3)
      | ^~~~
foo.cc:25:1: error: 'else' without a previous 'if'
   25 | else
      | ^~~~
foo.cc: In function 'int run(int)':
foo.cc:34:10: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   34 | if(a%4==0&&a%100!=0||a%400==0) r=1;
      |    ~~~~~~^~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:6:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    6 | scanf("%d,%d,%d",&year,&month,&day);
      | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1026 计算某日期的天数***
语言
C++
递交时间
2022-07-13 17:15:39
评测时间
2022-07-13 17:15:39
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes