class Date{
private:
int year;
int month;
int day;
public:
Date(int y=0,int m=0,int d=0):year(y),month(m),day(d){}
Date(const Date&D):year(D.year),month(D.month),day(D.day){}
int Getyear(){return year;}
int Getmonth(){return month;}
int Getday(){return day;}
void Dashow();
Date DaInput();
~Date(){}
};
Date Date::DaInput(){
int y,m,d;
cout<<" ****************年:";
cin>>y;
cout<<" ****************月:";
cin>>m;
cout<<" ****************日:";
cin>>d;
return Date(y,m,d);
}
void Date::Dashow(){
cout<<year<<" "<<"年"<<" "<<month<<" "<<"月"<<" "<<day<<" "<<"日"<<endl;
}
第三章
最新推荐文章于 2023-03-31 15:28:15 发布