#include<iostream>
#include<cstring>
using namespace std;
class Date{
private:
int year; int month; int day;
public:
bool set(int y,int m,int d);
void show();
int y1();
Date(int y,int m,int d){year=y; month=m; day=d;};
Date(){};
};
class student{
private:
int id;
char name[20];
Date roll;
static int number;
public:
void show1();
static void geNum(int N);
void getname(char *p);
student(Date &j){
strcpy(name,"ssdut");
j.set(2019,8,28);
id=j.y1()*1000+number;
number+=1;
roll.set(2019,8,28);
};
};
bool Date:: set(int y,int m,int d){
year=(y>=0)?y:0;
month=(m>=0&&m<=12)?m:0;
if((year%4==0&&year%100!=0)||year%400==0){
if(month==2){
day=(d>=0&&d<=29)?d:0;
}else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
day=(d>=0&&d<=31)?d:0;
}else if(month!=0){
day=(d>=0&&d<=30)?d:0;
}
}else if(year!=0){
if(month==2){
day=(d>=0&&d<=28)?d:0;
}else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
day=(d>=0&&d<=31)?d:0;
}else if(month!=0){
day=(d>=0&&d<=30)?d:0;
}
}
}
void Date:: show(){
cout<<month<<"/"<<day<<"/"<<year<<endl;
}
int Date::y1(){
int y0=year;
return y0;
}
void student::show1(){
cout<<"学号:"<<id<<endl;
cout<<"姓名:"<<name<<endl;
cout<<"学号:"<<number<<endl;
cout<<"入学时间:";
roll.show();
}
void student::geNum(int N){
number=N;
}
void student::getname(char *q){
strcpy(name,q);
}
int main(){
int n=1;
student::geNum(n);
Date k(1,1,1);
student k1(k);
k1.show1();
return 0;
}