主题:C++普通程序 不知道哪里出错了,求助
#include<iostream>
using namespace std;
class Time
{
private:
int hour;
int minute;
int second;
public:
Time(int h=0,int m=0,int s=0);hour(h),minute(m),second(s){}
void set(int h,int m,int s)
{hour=h;minute=m;second=s;}
void show()
{cout<<hour<<":"<<minute<<":"<<second<<endl;}
};
int main()
{
Time t1(1,2,3);
t1.show();
Time t2(t1);
t2.show();
system("PAUSE");
return 0;
}[size=3][/size][size=4][/size]
using namespace std;
class Time
{
private:
int hour;
int minute;
int second;
public:
Time(int h=0,int m=0,int s=0);hour(h),minute(m),second(s){}
void set(int h,int m,int s)
{hour=h;minute=m;second=s;}
void show()
{cout<<hour<<":"<<minute<<":"<<second<<endl;}
};
int main()
{
Time t1(1,2,3);
t1.show();
Time t2(t1);
t2.show();
system("PAUSE");
return 0;
}[size=3][/size][size=4][/size]