#include<iostream>
using namespace std;
class Time
{
public: //若定义时不加以声明为公用
void set_time(void); //则程序默认为私有
void show_time(void);
bool check();
private:
int a;
int hour;
int minute;
int sec;
};
Time t;
int main()
{
t.set_time();
t.show_time();
return 0;
}
void Time::set_time(void)
{
cin>>t.hour;
cin>>t.minute;
cin>>t.sec;
}
bool Time::check()
{
if(0<=t.hour<24&&0<=t.minute<60&&0<=t.sec<60)
return true;
else
return false;
}
void Time::show_time(void)
{
if (a=1)
cout<<t.hour<<":"<<t.minute<<":"<<t.sec<<endl;
else
cout<<"It is a error cin!"<<endl;
}
using namespace std;
class Time
{
public: //若定义时不加以声明为公用
void set_time(void); //则程序默认为私有
void show_time(void);
bool check();
private:
int a;
int hour;
int minute;
int sec;
};
Time t;
int main()
{
t.set_time();
t.show_time();
return 0;
}
void Time::set_time(void)
{
cin>>t.hour;
cin>>t.minute;
cin>>t.sec;
}
bool Time::check()
{
if(0<=t.hour<24&&0<=t.minute<60&&0<=t.sec<60)
return true;
else
return false;
}
void Time::show_time(void)
{
if (a=1)
cout<<t.hour<<":"<<t.minute<<":"<<t.sec<<endl;
else
cout<<"It is a error cin!"<<endl;
}