记录详情

Compile Error

/in/foo.cc: In member function 'void Date::Output()':
/in/foo.cc:39:3: error: 'cout' was not declared in this scope
   cout<<y<<" "<<m<<" "<<d<<endl;
   ^~~~
/in/foo.cc:39:28: error: 'endl' was not declared in this scope
   cout<<y<<" "<<m<<" "<<d<<endl;
                            ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:45:2: error: 'cin' was not declared in this scope
  cin>>y>>m>>d;
  ^~~
/in/foo.cc:47:9: error: conflicting declaration 'Date d'
  Date d(y,m,d);
         ^
/in/foo.cc:44:9: note: previous declaration as 'int d'
 int y,m,d,num;
         ^
/in/foo.cc:48:4: error: request for member 'Add' in 'd', which is of non-class type 'int'
  d.Add(num);
    ^~~
/in/foo.cc:49:4: error: request for member 'Output' in 'd', which is of non-class type 'int'
  d.Output();
    ^~~~~~

信息

递交者
类型
自测
题目
P1003 OO1-3 日期类Date
语言
C++
递交时间
2024-03-14 14:40:42
评测时间
2024-03-14 14:40:42
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes