Compile Error

foo.cc: In function 'int MonthDay(int, int)':
foo.cc:10:2: error: expected ',' or ';' before 'int'
   10 |  int day=31;
      |  ^~~
foo.cc:12:4: error: 'day' was not declared in this scope
   12 |    day=30;
      |    ^~~
foo.cc:15:4: error: 'day' was not declared in this scope
   15 |    day=28=leap
      |    ^~~
foo.cc:15:11: error: lvalue required as left operand of assignment
   15 |    day=28=leap
      |           ^~~~
foo.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
foo.cc: At global scope:
foo.cc:18:36: error: redefinition of 'int year'
   18 | int PassDay(int year,int month,int year)
      |                                ~~~~^~~~
foo.cc:18:17: note: 'int year' previously declared here
   18 | int PassDay(int year,int month,int year)
      |             ~~~~^~~~
foo.cc: In function 'int PassDay(int, int)':
foo.cc:20:10: error: 'day' was not declared in this scope
   20 |  int sum=day;
      |          ^~~
foo.cc: In function 'int main()':
foo.cc:29:21: error: too many arguments to function 'int PassDay(int, int)'
   29 |  cout<<PassDay(y,m,d)<<endl;
      |                     ^
foo.cc:18:5: note: declared here
   18 | int PassDay(int year,int month,int year)
      |     ^~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

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