【正文】
]\b\b)。scanf(%d,amp。w2)。 } }while(w2==1)。menu()。}snum() /*****************按學(xué)號(hào)搜索**********************/{FILE *fp。int i,n,k,p,w1=1,w2,w3,w4。n=load()。do {do { k=1。 printf(\n\nEnter the number that you want to search!\n\t\tnumber:[ ]\b\b\b\b\b)。 scanf(%s,)。for(i=0。i=n。i++)if(strcmp(,wk[i].num)==0) { k=i。 printf_one(k)。break。 }if(k==1) {printf(\n\nNO exist!please)。printf(\n\nAre you again?\n\t\t1\tagain\n\t\t2\tNO and back\n\t\t[ ]\b\b)。scanf(%d,amp。w1)。if(w1==1){snum()。break。}if(w1==2) menu()。break。 } } while(k==1amp。amp。w1==1)。w4=0。w3=0。if(k!=1)。 printf(\n\nWhat do you want to do ?\n\t\t1\tsearch another\n\t\t2\tmodify\n\t\t3\tDelete\n\t\t4\tback menu\n\t\t[ ]\b\b)。 scanf(%d,amp。w2)。 switch(w2) {case 1:snum()。break。case 2:w3=modify_data(k)。break。case 3:{printf(\nAre you sure?\n\t\t1\tsure\n\t\t2\tno and back\n\t\t[ ]\b\b)。 scanf(%d,amp。w4)。 if(w4==1) for(p=i。p=n。p++) wk[p]=wk[p+1]。 break。}case 4:menu()。break。 }if(w3==1||w4==1) {fp=fopen(,w)。for(p=0。p=n。p++) fprintf(fp,%s\t%s\t%1s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n,wk[p].num,wk[p].name,wk[p].sex,wk[p].age,wk[p].zhiwu,wk[p]. zhicheng,wk[p].zhengzhi,wk[p].xueli,wk[p].renzhisj,wk[p].laiyansj,wk[p].leibie)。 fclose(fp)。}printf(\n\n\t\tsuccessful!!\n)。printf(\n\nWhat do you want to do?\n\t\t1\tSearch another\n\t\t2\tBack\n\t\t[ ]\b\b)。scanf(%d,amp。w2)。 }while(w2==1)。menu()。}order() /**********************排序函數(shù)******************************/{int i,j,k,n,p,m。FILE *fp。n=load()。printf(which do you like to follow?\n\t\t1\tage\n\t\t2\tlaiyuanshijian\n\n)。scanf(%d,amp。p)。if(p==1) {for(i=0。i=n1。i++) {for(j=i+1。j=n。j++) {if(strcmp(wk[i].age,wk[j].age)0) {s=wk[i]。 wk[i]=wk[j]。 wk[j]=s。 } } } }if(p==2) {for(i=0。i=n1。i++) {for(j=i+1。j=n。j++) {if(strcmp(wk[i].laiyansj,wk[j].laiyansj)0) {s=wk[i]。 wk[i]=wk[j]。 wk[j]=s。 } }}}{fp=fopen(,w+)。for(m=0。m=n。m++) {if(fprintf(fp,%s\t%s\t%1s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n,wk[m].num,wk[m].name,wk[m].sex,wk[m].age,wk[m].zhiwu,wk[m]. zhicheng,wk[m].zhengzhi,wk[m].xueli,wk[m].renzhisj,wk[m].laiyansj,wk[m].leibie)==NULL){printf(cannot open the file,press any key to continue......)。getchar()。menu()。}} fclose(fp)。}printf(\n\n)。printf_back()。}del() /*****************刪除記錄函數(shù)***************/{char c。int i,j,n,k,m,w0=1,w1=0,w2=0。FILE *fpt。n=load()。do{k=1。printf_face()。for(i=0。i=n。i++) { if((i!=0)amp。amp。(i%10==0)) {printf(\n\nRemember the need delete.\npress any key to continue...)。getch()。printf(\n\n)。} printf_one(i)。}do {printf(\n\nEnter NO. that you want to delete!\n\t\tNO.[ ]\b\b)。scanf(%s,)。for(i=0。i=n。i++) if(strcmp(,wk[i].num)==0)。 {k=i。 s=wk[i]。 }if(k==1) printf(\n\nNO exit ! please again)。 } while(k==1)。printf_face()。printf_one(k)。printf(are you sure to delete the data? \t[y/n]\n\t\t[ ]\b\b)。 scanf(%1s,amp。c)。 if(c==39。y39。) { for(j=i。j=n。j++) wk[j]=wk[j+1]。 w1=1。 } else menu()。 if(w1==1) {printf(\nsuccessful!!\n\nDo yuo want to delete another?\n\n\t\t1\tYes\n\n\t\t2\tBack with save\n\t[]\b\b)。 scanf(%d,amp。w0)。 w2=1。 } if(w0!=1amp。amp。w2==1) {fpt=fopen(,w)。 for(m=0。mn。m++)fprintf(fpt,%s\t%s\t%1s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n,wk[m].num,wk[m].name,wk[m].sex,wk[m].age,wk[m].zhiwu,wk[m]. zhicheng,wk[m].zhengzhi,wk[m].xueli,wk[m].renzhisj,wk[m].laiyansj,wk[m].leibie)。fclose(fpt)。} } while(w0==1)。menu()。}data() /************統(tǒng)計(jì)函數(shù)******************/{int p。printf(what kind do you want to data?\n\t\t1\tthe number on duty\n\t\t2\tthe number of Party member\n\t\t3\tthe number of women\n\t\t4\tthe number of high education\n\t\t5\texit\n\n\t\t[ ]\b\b)。scanf(%d,amp。p)。 switch(p) {case 1:numduty()。break。case 2:numpm()。break。case 3:numwm()。break。case 4:hiedcation()。break。case 5:menu()。break。dafault:printf(the number must be between 1 and 4,please choose again!)。 data()。 }}numduty() /**************定義numduty函數(shù)*********************/{int i,j,p,k=0。int n。n=load()。for(i=0。i=n。i++)if(strcmp(wk[i].leibie,zaizhi)==0){printf_one(i)。k++。}printf(the number of the person on duty is %d,k)。}numpm() /*************定義numpm函數(shù)******************/{int i,j,p,k=0。int n。n=load()。for(i=0。i=n。i++)if(strcmp(wk[i].zhengzhi,dangyuan)==0){k++。printf_one(i)。}printf(the number of the partymember is %d,k)。}numwm() /***********定義numwm函數(shù)******************/{int i,j,p,k=0。int n。n=load()。for(i=0。i=n。i++)if(strcmp(wk[i].sex,39。w39。)==0){k++。printf_one(i)。}printf(the number of the women is %d,k)。}hiedcation() /****************************定義hieducation函數(shù)**************/{int i,p,k=0。int n。n=load()。for(i=0。i=n。i++)if(strcmp(wk[i].xueli,xueshi)==0||strcmp(wk[i].xueli,professor)==0||strcmp(wk[i].xueli,shuoshi)==0||strcmp(wk[i].xueli,benke)==0){k++。printf_one(i)。}printf(the number of the high edcation person is %d,k)。}main() /**********主函數(shù)開(kāi)始*****************************/{menu()。}小結(jié):八天的C語(yǔ)言課程設(shè)計(jì)結(jié)束了,在這八天的時(shí)間里,我自己獨(dú)立完成了一個(gè)程序從構(gòu)思結(jié)構(gòu),到編寫(xiě)代碼,然后上機(jī)調(diào)試運(yùn)行的過(guò)程,感覺(jué)自己收獲很大。通過(guò)解決一個(gè)又一個(gè)的問(wèn)題,熟悉了C語(yǔ)言的應(yīng)用,對(duì)計(jì)算機(jī)語(yǔ)言應(yīng)用的理解又深了一層,在老師的指導(dǎo)下,學(xué)會(huì)了模塊設(shè)計(jì)的方法,用流程圖表示算法,掌握了用C語(yǔ)言進(jìn)行程序設(shè)計(jì)的能力。在設(shè)計(jì)過(guò)程中,我理解了對(duì)于一個(gè)較大的程序,不可能一次編寫(xiě)出一個(gè)較大的系統(tǒng),通常要采取自頂向下的設(shè)計(jì)思想,先設(shè)