记录详情

Compile Error

/in/foo.cc:8:13: error: 'y' has not been declared
  Time(int x,y,z){
             ^
/in/foo.cc:8:15: error: 'z' has not been declared
  Time(int x,y,z){
               ^
/in/foo.cc: In constructor 'Time::Time(int, int, int)':
/in/foo.cc:9:13: error: 'y' was not declared in this scope
  h = x; m = y; s = z;
             ^
/in/foo.cc:9:20: error: 'z' was not declared in this scope
  h = x; m = y; s = z;
                    ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:21: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,y,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:21: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,y,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:25:13: error: no match for call to '(Time) (int&, int&, int&)'
  t1(x1,y1,z1);
             ^
/in/foo.cc:26:13: error: no match for call to '(Time) (int&, int&, int&)'
  t2(x2,y2,z2);
             ^
/in/foo.cc:28:12: error: invalid use of member function 'int Time::sum()' (did you forget the '()' ?)
  past = t2.sum - t1.sum;
         ~~~^~~
/in/foo.cc:28:21: error: invalid use of member function 'int Time::sum()' (did you forget the '()' ?)
  past = t2.sum - t1.sum;
                  ~~~^~~

信息

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