记录详情

Compile Error

/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:2: note: candidate: Time::Time(int, int, int)
  Time(int x,int y,int z):h(x),m(y),s(z){}
  ^~~~
/in/foo.cc:8:2: 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:2: note: candidate: Time::Time(int, int, int)
  Time(int x,int y,int z):h(x),m(y),s(z){}
  ^~~~
/in/foo.cc:8:2: 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 11:59:41
评测时间
2021-06-22 11:59:41
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes