#include
using namespace std;
class Time
{
public:
Time(int hour,int minute,int sec);
int set();
int show();
private:
int hour;
int minute;
int sec;
};
int Time::set()
{
cin>>hour>>minute>>sec;
}
int Time::show()
{
cout<<hour<<"h"<<minute<<"s"<<sec<int main( )
{
Time t;
cout<<"enter the time:"<0;
}
构造函数你没有实现代码啊。光有一个构造函数申明
加上构造函数并且写成带默认参数的构造参数,否则后面Time t 是不对的
Time(int hour1=1,int minute1=1,int sec1=1)
{
hour=hour1;
minute=minute1;
sec=sec1;
}
你这一句后面的也有问题
cout<<"enter the time:"<0;