文经学院文计121-1 宋政道 头文件 #include<iostream> using namespace std; class time { public: void set_time(); void show_time(); private: int hour; int minute; int second; }; void time::set_time() { cin>>hour; cin>>minute; cin>>second; } void time::show_time() { cout<<hour<<":"<<minute<<":"<<second<<endl; } 主函数 #include<iostream> #include"szd111.h" using namespace std; int main() { time t; t.set_time(); t.show_time(); return 0; }