91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-02
  • 語言: C/C++
  • 標簽: ef??

資源簡介

包括學生姓名,地址,年齡,籍貫等保存到文件,從文件讀取??梢宰约簲U充功能,

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?

#define?title?“學生成績管理系統(tǒng)“??/*標題文字*/
#define?MAX?10?/*?*/

#define?MENU_MAIN_COUNT?9?/*?主菜單的選項個數(shù)*/
#define?MENU_SEARCH_COUNT?4?/*查詢子菜單的選項個數(shù)?*/
#define?MENU_CALC_COUNT?3?/*統(tǒng)計子菜單的選項個數(shù)?*/

typedef?struct?student{
char?name[MAX];?/*姓名*/
char??sex[MAX];//性別?
char?num[MAX];??/*學號*/
char?ad[MAX];??/*籍貫*/
char?age[MAX];//年齡?
char?dager[MAX];//成績?

struct?student?*next;??/*指向下一個學生的指針*/
}stu;

stu?*head?=?NULL;?/*定義結構體鏈表的頭指針*/?

char?menu_main[]?=?
“|\n“
“|?1?輸入學生記錄?\n“
“|?2?查看所有學生信息?\n“
//“|?3?\n“
“|?3??編輯學生記錄?\n“
“|?4?刪除學生記錄\n“
//“|?6?\n“
“|?5?保存文件\n“
“|?6?讀取文件\n“
“|?7?退出\n“
“|\n“;?

void?print_menu_tile(char?*title){
printf(“=======================================\n“);
printf(“|?%s\n“?title);
printf(“---------------------------------------\n“);
}


void?input_record(){
printf(“正在執(zhí)行input_record函數(shù)...\n“);
getch();
}


void?create_stu_by_input(stu?*pNewStu){
printf(“>請輸入學生信息(注:最大長度是10個字符):\n“);
printf(“學號:“);?scanf(“%s“pNewStu->num);
printf(“性別:“);?scanf(“%s“pNewStu->sex);
printf(“姓名:“);?scanf(“%s“pNewStu->name);
printf(“籍貫:“);?scanf(“%s“pNewStu->ad);
printf(“年齡:“);?scanf(“%s“pNewStu->age);
printf(“成績:“);?scanf(“%s“pNewStu->dager);


}

stu*?get_last_student(stu?*p){
if(p->next?==?NULL){
return?p;
}
else{
get_last_student(p->next);
}
}

void?input_record1(){
void?print_menu_main();
char?continue_input?=?‘N‘;
stu?*pLastStu?=?NULL;
stu?*pNewStu?=?(stu?*)malloc(sizeof(stu));
pNewStu->next?=?NULL;
create_stu_by_input(pNewStu);
if(head?==?NULL){
head?=?pNewStu;
}??
else{
pLastStu?=?get_last_student(head);
pLastStu->next?=?pNewStu;
}

printf(“繼續(xù)輸入學生信息?(Y?繼續(xù),?N?返回菜單)“);
getchar();
continue_input?=?getchar();
if?(continue_input?==?‘n‘?||?continue_input?==?‘N‘){
print_menu_main();
}
else{
input_record1();
}
}


/*void?show_record(){
printf(“正在執(zhí)行show_record函數(shù)...\n“);
getch();
}*/

?
void?print_table_head(){
printf(“+----------+----------+----------+----------+----------+----------+\n“);
printf(“|???學號???|???性別???|??姓名???|??籍貫??|???年齡???|??成績????|\n“);
printf(“+----------+----------+----------+----------+----------+----------+\n“);
}

void?print_table_buttom(){
printf(“+----------+----------+----------+----------+----------+----------+\n“);
}??

void?print_table_row(stu?*p){
printf(“|%10s|%10s|%10s|%10s|%10s|%10s|\n“p->nump->sexp->namep->adp->agep->dager);
}

void?show_record1(){
void?print_menu_main();
stu?*p?=?head;
print_table_head();
while(p?!=?NULL)?{
print_table_row(p);
p?=?p->next;
}
print_table_buttom();
printf(“按任意鍵返回菜單...\n“);
getch();
getchar();
getchar();
p

評論

共有 條評論