main
p2jvg4k7s 5 months ago
parent 1251a81ad2
commit 80c67be8ba

27
1.cpp

@ -0,0 +1,27 @@
#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;
}
Loading…
Cancel
Save