You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
399 B

#include <iostream>
using namespace std;
class Time
{
public:
void setTime();
void showTime();
int hour, minute, sec;
};
void fun(Time &t)
{ t.hour=23; }
void Time::setTime()
{ cin>>hour>>minute>>sec; }
void Time::showTime()
{ cout<<hour<<":"<<minute<<":"<<sec<<endl;
}
int main()
{ Time t;
t.setTime();
fun(t);
t.showTime();
return 0;
}