#include <iostream>
using namespace std;
class Time
{public:
void set_time(void);
void show_time(void);
private:
int hour;
int minute;
int sec;
};
void Time::set_time(void)<img src="https://img-blog.csdn.net/20150415172129618?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvTWFvX3phaQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
{cin>>hour;
cin>>minute;
cin>>sec;
}
void Time::show_time(void)
{cout<<hour<<":"<<minute<<":"<<sec<<endl;}
Time t;
int main()
{ t.set_time();
t.show_time();
return 0;
}
2.3
最新推荐文章于 2024-03-13 15:15:09 发布