📄 structs.h
字号:
/*structs.h*/
#define MAX_SUBJECT_NAME 20
#define MAX_SCHOOL_NAME 20
#define MAX_STUDENT_NAME 20
typedef struct _SUBJECT
{
int num;
int sex; /*0:male,1:female*/
char name[MAX_SUBJECT_NAME];
int scoring_kind; /*0:the front 3 have score,1:the front 5 have score*/
}SUBJECT;
void subject_copy(SUBJECT *s1,SUBJECT *s2)
{
s1->sex=s2->sex;
s1->num=s2->num;
s1->scoring_kind=s2->scoring_kind;
strcpy(s1->name,s2->name);
}
typedef struct _SCHOOL{
int num;
char name[MAX_SCHOOL_NAME];
}SCHOOL;
void school_copy(SCHOOL *s1,SCHOOL *s2)
{
s1->num=s2->num;
strcpy(s1->name,s2->name);
}
typedef struct _STUDENT{
char name[MAX_STUDENT_NAME];
int subject_num;
int school_num;
int place;
}STUDENT;
void student_copy(STUDENT *s1,STUDENT *s2)
{
s1->subject_num=s2->subject_num;
s1->school_num=s2->school_num;
s1->place=s2->place;
strcpy(s1->name,s2->name);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -