记录详情

Compile Error

/in/foo.cc:20:2: error: 't' does not name a type
  t=h*3600+m*60+s;
  ^
/in/foo.cc: In constructor 'Time::Time(int, int, int)':
/in/foo.cc:7:32: error: class 'Time' does not have any field named 'hour'
  Time(int h=0,int m=0,int s=0):hour(h),minute(m),second(s){}
                                ^~~~
/in/foo.cc:7:40: error: class 'Time' does not have any field named 'minute'
  Time(int h=0,int m=0,int s=0):hour(h),minute(m),second(s){}
                                        ^~~~~~
/in/foo.cc:7:50: error: class 'Time' does not have any field named 'second'
  Time(int h=0,int m=0,int s=0):hour(h),minute(m),second(s){}
                                                  ^~~~~~
/in/foo.cc: In member function 'void Time::set()':
/in/foo.cc:14:4: error: 'hour' was not declared in this scope
    hour=h,minute=m,second=s;
    ^~~~
/in/foo.cc:14:11: error: 'minute' was not declared in this scope
    hour=h,minute=m,second=s;
           ^~~~~~
/in/foo.cc:14:20: error: 'second' was not declared in this scope
    hour=h,minute=m,second=s;
                    ^~~~~~
/in/foo.cc: At global scope:
/in/foo.cc:22:11: error: '::main' must return 'int'
 void main()
           ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:25:2: error: expected initializer before 't1'
  t1=t1.Time();
  ^~
/in/foo.cc:26:2: error: 't2' was not declared in this scope
  t2=t2.Time();
  ^~
/in/foo.cc:27:2: error: 'y' was not declared in this scope
  y=t2-t1;
  ^
/in/foo.cc:27:7: error: 't1' was not declared in this scope
  y=t2-t1;
       ^~

信息

递交者
类型
递交
题目
P1001 OO1-2 时间类Time
比赛
《面向对象的程序设计方法》的课程测验
语言
C++
递交时间
2021-06-22 11:57:00
评测时间
2021-06-22 11:57:00
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes