#include<iostream>
using namespace std;
class clock{
public:
void settime(int newh=0,int newm=0,int news=0);
void showtime();
private:
int hour,minute,second;
};
void clock::settime(int newh=0,int newm=0,int news=0)
{hour=newh;minute=newm;second=news;}
inline void clock::showtime()
{cout<<hour<<":"<<minute<<":"<<second<<endl;}
int main(){
clock m;
cout<<"first time set and output"<<endl;
m.settime();
m.showtime();
cout<<"second time set and output"<<endl;
m.settime(8,32,41);
m.showtime();
return 0;}
catspeake
互换的青春
相关分类