记录详情

Compile Error

/in/foo.cc: In member function 'int Date::Sub(Date&)':
/in/foo.cc:38:23: warning: for increment expression has no effect [-Wunused-value]
   {for(int i=D.y;i--;i>=y)
                      ~^~~
/in/foo.cc:39:17: error: no matching function for call to 'Date::isLeap(int&)'
   yday+=isLeap(i);}
                 ^
/in/foo.cc:12:6: note: candidate: int Date::isLeap()
  int isLeap()
      ^~~~~~
/in/foo.cc:12:6: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:40:20: warning: for increment expression has no effect [-Wunused-value]
   for(int i=m;m--;m>1)
                   ~^~
/in/foo.cc:42:17: error: no matching function for call to 'Date::Monthday(int&)'
   m1+=Monthday(m);
                 ^
/in/foo.cc:19:6: note: candidate: int Date::Monthday()
  int Monthday()
      ^~~~~~~~
/in/foo.cc:19:6: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:40:11: warning: unused variable 'i' [-Wunused-variable]
   for(int i=m;m--;m>1)
           ^
/in/foo.cc:44:26: warning: for increment expression has no effect [-Wunused-value]
   for(int i=D.m;D.m--;D.m>1)
                       ~~~^~
/in/foo.cc:46:19: error: no matching function for call to 'Date::Monthday(int&)'
   m2+=Monthday(D.m);
                   ^
/in/foo.cc:19:6: note: candidate: int Date::Monthday()
  int Monthday()
      ^~~~~~~~
/in/foo.cc:19:6: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:44:11: warning: unused variable 'i' [-Wunused-variable]
   for(int i=D.m;D.m--;D.m>1)
           ^
/in/foo.cc:48:3: error: 'delta' was not declared in this scope
   delta=yday+m2-m1+D.d-d;
   ^~~~~

信息

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