Compile Error

foo.cc: In function 'int main()':
foo.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin>>year>>month;
      |     ^~~
foo.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout<<left<<setw(4)<<"Sun"<<setw(4)<<"Mon"<<setw(4)<<"Tue"<<setw(4)<<"Wed"<<setw(4)<<"Thr"<<setw(4)<<"Fri"<<setw(4)<<"Sat"<<endl;
      |     ^~~~
foo.cc:11:11: error: 'left' was not declared in this scope
   11 |     cout<<left<<setw(4)<<"Sun"<<setw(4)<<"Mon"<<setw(4)<<"Tue"<<setw(4)<<"Wed"<<setw(4)<<"Thr"<<setw(4)<<"Fri"<<setw(4)<<"Sat"<<endl;
      |           ^~~~
foo.cc:11:17: error: 'setw' was not declared in this scope
   11 |     cout<<left<<setw(4)<<"Sun"<<setw(4)<<"Mon"<<setw(4)<<"Tue"<<setw(4)<<"Wed"<<setw(4)<<"Thr"<<setw(4)<<"Fri"<<setw(4)<<"Sat"<<endl;
      |                 ^~~~
foo.cc:11:129: error: 'endl' was not declared in this scope
   11 |     cout<<left<<setw(4)<<"Sun"<<setw(4)<<"Mon"<<setw(4)<<"Tue"<<setw(4)<<"Wed"<<setw(4)<<"Thr"<<setw(4)<<"Fri"<<setw(4)<<"Sat"<<endl;
      |                                                                                                                                 ^~~~
foo.cc: In function 'int isLeapYear(int)':
foo.cc:23:18: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   23 |  return year%4==0&&year%100!=0||year%400==0;
      |         ~~~~~~~~~^~~~~~~~~~~~~
foo.cc: At global scope:
foo.cc:39:4: warning: unnecessary parentheses in declaration of 'passDays' [-Wparentheses]
   39 | int(passDays(int year,int month,int day))
      |    ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1075 打印月历
语言
C++
递交时间
2022-07-13 20:07:36
评测时间
2022-07-13 20:07:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes