#include <iostream>
using namespace std;
class Time{
public:
void set_time();
void out_time();
private:
int hour;
int minute;
int second;
};
void Time:: out_time(){
cout<<hour<<"时 "<<minute <<" 分 "<< second << "秒"<< endl;
}
void Time::set_time(){
cin >>hour;
cin >>minute;
cin >>second;
}
int main()
{
Time t1,*p;
p=&t1;
p->set_time();
t1.out_time();
return 0;
}
文章评论