📄 s01.cpp
字号:
#include<iostream.h>
#include<cstring>
#include"people.h"
void people::setname(char *names) //设置姓名
{
strcpy(name,names);
}
char *people::Getname() //获取姓名
{
return name;
}
void people::setnumber(char *num) //设置编号
{
strcpy(number,num);
}
char *people::Getnumber() //获取编号
{
return number;
}
void people::setsex(char *morf) //设置性别
{
strcpy(sex,morf);
}
char *people::Getsex() //获取性别
{
return sex;
}
void people::setid(char *card) //设置身份证号
{
strcpy(id,card);
}
char *people::Getid() //获取身份证号
{
return id;
}
void people::setclassify()
{
cout<<"000";
}
student::student(date birthday) //内嵌构造函数
{
syear=birthday.year;
smonth=birthday.month;
sday=birthday.day;
}
void student::setclassno(char *no) //设置班号
{
strcpy(classno,no);
}
char *student::Getclassno() //获取班号
{
return classno;
}
void student::setclassify()
{
cout<<"student";
}
teacher::teacher(date birthday) //内嵌构造函数
{
tyear=birthday.year;
tmonth=birthday.month;
tday=birthday.day;
}
void teacher::setclassify()
{
cout<<"teacher";
}
void teacher::setprinapalship(char *profess) //设置职务
{
strcpy(prinapalship,profess);
}
char *teacher::Getprinapalship() //获取职务
{
return prinapalship;
}
void teacher::setdepartment(char *depart) //设置部门
{
strcpy(department,depart);
}
char *teacher::Getdepartment() //获取部门
{
return department;
}
graduate::graduate(date birthday)
{
gyear=birthday.year;
gmonth=birthday.month;
gday=birthday.day;
}
void graduate::setsubject(char *subj) //设置专业
{
strcpy(subject,subj);
}
char *graduate::Getsubject() //获取专业
{
return subject;
}
void graduate::setteacheradviser(char *tadviser) //设置导师
{
strcpy(teacheradviser,tadviser);
}
char *graduate::Getteacheradviser() //获取导师
{
return teacheradviser;
}
void graduate::setclassify()
{
cout<<"graduate";
}
TA::TA(date birthday)
{
tayear=birthday.year;
tamonth=birthday.month;
taday=birthday.day;
}
void TA::setclassify()
{
cout<<"teacheradviser";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -