记录详情

Compile Error

/in/foo.cc:8:29: error: return type specification for constructor invalid
  void Time(int x,int y,int z):h(x),m(y),s(z){}
                             ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:18:7: error: no matching function for call to 'Time::Time()'
  Time t1,t2;
       ^~
/in/foo.cc:8:7: note: candidate: Time::Time(int, int, int)
  void Time(int x,int y,int z):h(x),m(y),s(z){}
       ^~~~
/in/foo.cc:8:7: note:   candidate expects 3 arguments, 0 provided
/in/foo.cc:4:7: note: candidate: constexpr Time::Time(const Time&)
 class Time{
       ^~~~
/in/foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:4:7: note: candidate: constexpr Time::Time(Time&&)
/in/foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:18:10: error: no matching function for call to 'Time::Time()'
  Time t1,t2;
          ^~
/in/foo.cc:8:7: note: candidate: Time::Time(int, int, int)
  void Time(int x,int y,int z):h(x),m(y),s(z){}
       ^~~~
/in/foo.cc:8:7: note:   candidate expects 3 arguments, 0 provided
/in/foo.cc:4:7: note: candidate: constexpr Time::Time(const Time&)
 class Time{
       ^~~~
/in/foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:4:7: note: candidate: constexpr Time::Time(Time&&)
/in/foo.cc:4:7: note:   candidate expects 1 argument, 0 provided
/in/foo.cc:22:13: error: no match for call to '(Time) (int&, int&, int&)'
  t1(x1,y1,z1);
             ^
/in/foo.cc:23:13: error: no match for call to '(Time) (int&, int&, int&)'
  t2(x2,y2,z2);
             ^

信息

递交者
类型
自测
题目
P1001 OO1-2 时间类Time
语言
C++
递交时间
2021-06-22 12:00:05
评测时间
2021-06-22 12:00:05
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes