Compile Error

foo.cc:5:23: error: 'month' has not been declared
 int monthday(int year,month);
                       ^~~~~
foo.cc: In function 'int main()':
foo.cc:11:3: error: 'sum' was not declared in this scope
   sum+=monthday(year,month);
   ^~~
foo.cc:11:17: error: 'year' was not declared in this scope
   sum+=monthday(year,month);
                 ^~~~
foo.cc:11:17: note: suggested alternative: 'char'
   sum+=monthday(year,month);
                 ^~~~
                 char
foo.cc:11:22: error: 'month' was not declared in this scope
   sum+=monthday(year,month);
                      ^~~~~
foo.cc:11:22: note: suggested alternative: 'monthday'
   sum+=monthday(year,month);
                      ^~~~~
                      monthday
foo.cc:13:8: error: 'yy' was not declared in this scope
  cout<<yy<<"-"<<mm<<"-"<<"dd"<<endl;
        ^~
foo.cc:13:8: note: suggested alternative: 'y'
  cout<<yy<<"-"<<mm<<"-"<<"dd"<<endl;
        ^~
        y
foo.cc:13:17: error: 'mm' was not declared in this scope
  cout<<yy<<"-"<<mm<<"-"<<"dd"<<endl;
                 ^~
foo.cc:13:17: note: suggested alternative: 'm'
  cout<<yy<<"-"<<mm<<"-"<<"dd"<<endl;
                 ^~
                 m
foo.cc: In function 'int isleap(int)':
foo.cc:21:30: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  if(year%400==0 || year%4==0 && year%100!=0 )
                    ~~~~~~~~~~^~~~~~~~~~~~~~
foo.cc: At global scope:
foo.cc:26:23: error: 'month' has not been declared
 int monthday(int year,month)
                       ^~~~~
foo.cc: In function 'int monthday(int, int)':
foo.cc:29:5: error: 'month' was not declared in this scope
  if(month==4 || month==6 || month==9 || month==11 )
     ^~~~~
foo.cc:29:5: note: suggested alternative: 'monthday'
  if(month==4 || month==6 || month==9 || month==11 )
     ^~~~~
     monthday
foo.cc:31:5: error: 'month' was not declared in this scope
  if(month==2)
     ^~~~~
foo.cc:31:5: note: suggested alternative: 'monthday'
  if(month==2)
     ^~~~~
     monthday
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1046 生日日数
语言
C++
递交时间
2021-09-21 22:13:16
评测时间
2021-09-21 22:13:16
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes