《C語言程序設(shè)計(jì)基礎(chǔ)》上機(jī)實(shí)驗(yàn)報(bào)告(模版)_第1頁
《C語言程序設(shè)計(jì)基礎(chǔ)》上機(jī)實(shí)驗(yàn)報(bào)告(模版)_第2頁
《C語言程序設(shè)計(jì)基礎(chǔ)》上機(jī)實(shí)驗(yàn)報(bào)告(模版)_第3頁
《C語言程序設(shè)計(jì)基礎(chǔ)》上機(jī)實(shí)驗(yàn)報(bào)告(模版)_第4頁
《C語言程序設(shè)計(jì)基礎(chǔ)》上機(jī)實(shí)驗(yàn)報(bào)告(模版)_第5頁
已閱讀5頁,還剩24頁未讀, 繼續(xù)免費(fèi)閱讀

付費(fèi)下載

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、成都信息工程學(xué)院計(jì)算機(jī)系課程實(shí)驗(yàn)報(bào)告實(shí)驗(yàn)課程:C語言程序設(shè)計(jì)2實(shí)驗(yàn)項(xiàng)目:職工管理系統(tǒng)指導(dǎo)教師: 李莉麗學(xué)生姓名:桂柯 學(xué)生學(xué)號:2010051102班 級:計(jì)科3班實(shí)驗(yàn)地點(diǎn): 5201實(shí)驗(yàn)時(shí)間:2011 年 5月 11日 點(diǎn) 點(diǎn)實(shí)驗(yàn)成績:評閱老師:李莉麗(說明:實(shí)驗(yàn)報(bào)告必須包含下面的每項(xiàng)內(nèi)容,根據(jù)實(shí)驗(yàn)情況認(rèn)真填寫,封面必須打印或復(fù)?。ˋ4紙),書寫上機(jī)實(shí)驗(yàn)報(bào)告內(nèi)容的紙張也用A4紙,最后從側(cè)面裝訂)一【上機(jī)實(shí)驗(yàn)?zāi)康摹客ㄟ^親自設(shè)計(jì)程序,可以令我們熟悉c語言操作,更熟練的掌握c語句。初步體會編程的過程,為將來的程序深入學(xué)習(xí)打下基礎(chǔ)和培養(yǎng)興趣。二【實(shí)驗(yàn)環(huán)境】TC2.0三【上機(jī)實(shí)驗(yàn)內(nèi)容】職工信息管理系統(tǒng)

2、要求:職工信息包括職工號,姓名,性別,年齡,學(xué)歷,工資,住址,電話等(職工號不相等)。試設(shè)計(jì)一職工信息管理系統(tǒng),使之能夠提供下列功能: (1)系統(tǒng)以菜單方式工作 (2)職工信息錄入功能(職工信息用文件保存) (3)職工信息瀏覽功能 (4)職工信息查詢功能,查詢方式: 1)按學(xué)歷查詢 2)按職工號查詢 (5) 職工信息刪除,修改功能(可選項(xiàng))。思路:(1)錄入并向文件里保存數(shù)據(jù)的實(shí)現(xiàn)思路:C語言并沒有提供由鍵盤輸入數(shù)據(jù)直接錄入文件的功能,只有內(nèi)存變量向文件寫入數(shù)據(jù)的功能,而由鍵盤輸入數(shù)據(jù)可以到內(nèi)存變量,因此實(shí)現(xiàn)此部分功能時(shí),應(yīng)當(dāng)由鍵盤將數(shù)據(jù)放入變量,再由變量寫入文件。這里錄入要求不采用書上例子,

3、它是用結(jié)構(gòu)體數(shù)組,我們要求只用一個(gè)結(jié)構(gòu)體實(shí)現(xiàn)。先將一個(gè)人的信息放入結(jié)構(gòu)體,將這個(gè)結(jié)構(gòu)體數(shù)據(jù)寫入文件后,再將下一個(gè)人的信息繼續(xù)放在這個(gè)結(jié)構(gòu)體中,再將這個(gè)結(jié)構(gòu)體寫入文件。這樣節(jié)省內(nèi)存空間。計(jì)算并修改文件里數(shù)據(jù)的實(shí)現(xiàn)思路:這部分的功能的實(shí)現(xiàn)應(yīng)當(dāng)先將文件的數(shù)據(jù)讀到變量當(dāng)中,在變量當(dāng)中完成計(jì)算,再將數(shù)據(jù)寫入文件。如果只是修改文件的數(shù)據(jù),并不計(jì)算,則可以直接定位到文件中相應(yīng)的位置,寫入數(shù)據(jù),則把原來的數(shù)據(jù)覆蓋以完成修改。(2)向文件里追加數(shù)據(jù)的實(shí)現(xiàn)思路:文件本身提供了這項(xiàng)功能,只要以 “a”的方式打開就行。然后向文件寫入的數(shù)據(jù),直接放在文件末尾。(3)查找文件里是否有某項(xiàng)數(shù)據(jù)的實(shí)現(xiàn)思路:C語言并沒有提供判

4、斷文件內(nèi)容的功能,必須將文件內(nèi)容讀到變量里再進(jìn)行判斷。實(shí)際的查找可能是在大量的數(shù)據(jù)里的查找,高效的查找是折半查找(下學(xué)期的數(shù)據(jù)結(jié)構(gòu)專門講這一內(nèi)容),折半的前提是排序,因此需先對排序后的文件讀出,以折半方式查找。(這要要求,是希望鞏固折半查找與排序兩個(gè)重要算法,至于它的時(shí)空效率是否高,可以學(xué)完數(shù)據(jù)結(jié)構(gòu)知識后自己再判斷)。(4)根據(jù)要求顯示文件里的某些數(shù)據(jù)或全部數(shù)據(jù)的實(shí)現(xiàn)思路:C語言沒有提供將文件內(nèi)容顯示的功能,所以需要將文件內(nèi)容讀到變量里,再顯示變量。(5)在文件里插入或刪除某項(xiàng)數(shù)據(jù)的實(shí)現(xiàn)思路:C語言同樣沒有直接提供該項(xiàng)功能,因此必須借由內(nèi)存變量完成。由以前的知識知道,在大量的數(shù)據(jù)里刪除一個(gè)數(shù),

5、用數(shù)組表示不合適,因?yàn)樯婕暗酱罅康臄?shù)據(jù)的移動(dòng),用鏈表是合適的,效率高(關(guān)于這一點(diǎn),在數(shù)據(jù)結(jié)構(gòu)這門課有詳細(xì)的講解)。因此完成這部分操作要求用鏈表實(shí)現(xiàn),先將文件里的數(shù)據(jù)讀出組織成鏈表,在鏈表上完成插入與刪除后,再將鏈表中的數(shù)據(jù)寫入文件。(6)按某個(gè)數(shù)據(jù)項(xiàng)進(jìn)行排序生成排序文件的實(shí)現(xiàn)思路:排序是在數(shù)組里實(shí)現(xiàn)。因此先要將文件里的數(shù)據(jù)讀到數(shù)組里,將數(shù)組排完序后,再將數(shù)據(jù)寫入文件(一般寫入一個(gè)新文件)。四【上機(jī)調(diào)試程序流程圖】1.顯示主菜單(以如下程序作為介紹)2. 添加職工信息3. 瀏覽職工信息。4. 查詢職工信息。4(1)根據(jù)標(biāo)號查詢職工信息。(2) 根據(jù)姓名查詢職工信息。(3) 根據(jù)年齡查詢職工信息。

6、5. 修改職工信息。瀏覽修改后的職工信息。6. 刪除職工信息。瀏覽刪除后的職工信息。7. 用鏈表添加職工信息。瀏覽添加后的職工信息。五【上機(jī)調(diào)試中出現(xiàn)的錯(cuò)誤信息、錯(cuò)誤原因及解決辦法】1. 光條菜單的錯(cuò)誤:剛開始只能用鍵盤上的英文字母控制光條上下移動(dòng),想用上下箭頭的ASCII代碼,結(jié)果錯(cuò)誤不能上下移動(dòng)解決方法:使用鍵盤掃描碼。2、瀏覽函數(shù) scan()在調(diào)試和鏈接的時(shí)候都沒有出現(xiàn)錯(cuò)誤提示,但在運(yùn)行的時(shí)候出現(xiàn)了問題。寫入指定位置的文件,打開后總會有亂碼。與c語言課本上的例題對照后發(fā)現(xiàn),我寫的fopen("wenjian","ab")沒有指定文件的存儲類型。解

7、決方法:在文件名wenjian后面加上.txt后即可。3.瀏覽函數(shù)scan()遇到的問題雖然不大,但解決起來很麻煩。理想的運(yùn)行結(jié)果是美觀整齊。即下面的職工信息分別與第一個(gè)printf輸出的中文項(xiàng)目提示對齊。解決方法:不斷修改空格個(gè)數(shù),不斷運(yùn)行察看效果。4.程序運(yùn)行后菜單界面不消失解決方法:使用清屏函數(shù),是每次運(yùn)行后界面還原。5.功能函數(shù)運(yùn)行完后會跳出界面,直接退出。解決方法:在每個(gè)功能函數(shù)的后面加如返回值。六【上機(jī)調(diào)試后的源程序及還存在的問題】源程序:#include<stdio.h>#include<conio.h>#define ESC 0x1b/*鍵盤掃描碼*/#

8、define ENTER 0x0d#define UP 0x48#define DOWN 0x50#define LEFT 0x4b#define RIGHT 0x4dtypedef struct /*定義存放職工信息的類型*/int No;int age;char name20;WORKERBASIC;typedef struct workerWORKERBASIC workerinfo;struct worker *next;WORKER;void cleanscreen()/*清屏*/int i,j;gotoxy(1,1);textbackground(RED);for(i=1;i<

9、;=25;i+)for(j=1;j<=80;j+)cprintf(" ");clrscr();void Initial()/*定義初始化程序的函數(shù)*/int i,j;char list720="1. Add",/*菜單名*/"2. Scan","3. Edit","4. Modify","5. Delete","6. Into","7. Exit"cleanscreen();textbackground(YELLOW);for(i

10、=1;i<=14;i+)/*畫窗口*/for(j=1;j<=80;j+)if (i=1|i=14|j<=2|(j>=79)cprintf(" ");else if (i>=3&&i<=12&&j>=5&&j<=76)cprintf(" ");elseprintf(" ");gotoxy(32,4);textcolor(BLACK);cprintf("W E L C O M E !");gotoxy(31,14);cpri

11、ntf("Worker System - BY GK");for(i=0;i<7;i+)/*顯示菜單*/gotoxy(34,i+6);cprintf("%s",listi);void PrintPause()/*暫停*/printf("Press any key to go on . . .");getch();void Guangtiao(int flag)/*定義畫光條的函數(shù)*/char list720="1. Add","2. Scan","3. Edit",&q

12、uot;4. Modify","5. Delete","6. Into","7. Exit"gotoxy(34,flag+5);textcolor(WHITE);textbackground(BLACK);cprintf("%s",listflag-1);textcolor(LIGHTGRAY);int Add()/*添加信息*/WORKERBASIC new;FILE *fp=NULL;char ch='y'while(ch='y')cleanscreen();print

13、f("Please input the worker's No. ");scanf("%d",&new.No);getchar();printf("Please input the worker's age: ");scanf("%d",&new.age);getchar();printf("Please input the worker's name: ");scanf("%s",);getchar();if(fp=f

14、open("wenjian.txt","ab")=NULL)fp=fopen("wenjian.txt","wb");if(fwrite(&new,sizeof(WORKERBASIC),1,fp)!=1)printf("add failed!n");PrintPause();fclose(fp);printf("whether go on(y or n):");scanf("%c",&ch);return 0;int Scan()/*查看

15、信息*/WORKERBASIC load;FILE *fp=NULL;int n=0;cleanscreen();if(fp=fopen("wenjian.txt","rb")=NULL)printf("can not find wenjian!n");PrintPause();return 0;printf("-n");printf("No.tworker'sagetworker'namen");while(!feof(fp)if (fread(&load,sizeof

16、(WORKERBASIC),1,fp)=1)n+;elsebreak;printf("%dt%dtt%sn",load.No,load.age,);printf("-n");printf("total:%dn",n);fclose(fp);PrintPause();return 0;void exchange(WORKERBASIC *max,WORKERBASIC *min)/*調(diào)換兩個(gè)職工在數(shù)組中的位置*/WORKERBASIC t;strcpy(,max->name);t.No=max->

17、;No;strcpy(max->name,min->name);max->No=min->No;strcpy(min->name,);min->No=t.No;int EditByNo(WORKERBASIC *F1,int n)/*按編號查找*/int i,j,k,num,high,low,mid,flag=0;for(i=0;i<n-1;i+)/*排序*/k=i;for(j=i+1;j<n;j+)if (F1+k*sizeof(WORKERBASIC)->No) > (F1+j*sizeof(WORKERBASIC)-

18、>No)k=j;if (k!=i)exchange(F1+i*sizeof(WORKERBASIC),(F1+k*sizeof(WORKERBASIC);/*此顯示信息只為說明職工已按編號排序,該部分可刪除*/printf("-n");printf("No.tworker'agettworker'namen");for(i=0;i<n;i+)printf("%dt%dttt%sn",(F1+i*sizeof(WORKERBASIC)->No,(F1+i*sizeof(WORKERBASIC)->

19、age,(F1+i*sizeof(WORKERBASIC)->name);printf("-n");printf("nPlease input a number you want to search: ");scanf("%d",&num);getchar();low=0;/*折半法*/high=n-1;while(low<=high)&&(flag=0)mid=(low+high)/2;if (num>(F1+mid*sizeof(WORKERBASIC)->No)low=mid+1;

20、else if (num<(F1+mid*sizeof(WORKERBASIC)->No)high=mid-1;else if (num=(F1+mid*sizeof(WORKERBASIC)->No)flag=1;if (flag=0)printf("can not find the worker!n");elseprintf("-n");printf("No.tworker'agettworker'namen");printf("%dt%dttt%sn",(F1+mid*siz

21、eof(WORKERBASIC)->No,(F1+mid*sizeof(WORKERBASIC)->age,(F1+mid*sizeof(WORKERBASIC)->name);printf("-n");PrintPause();return 0;int EditByName(WORKERBASIC *F1,int n)/*按姓名查找*/char str20;int i,j,k,flag=0,low,high,mid;for(i=0;i<n-1;i+)/*排序*/k=i;for(j=i+1;j<n;j+)if (strcmp( (F1+k*si

22、zeof(WORKERBASIC)->name, (F1+j*sizeof(WORKERBASIC)->name )>0)k=j;if (k!=i)exchange(F1+i*sizeof(WORKERBASIC),(F1+k*sizeof(WORKERBASIC);/*此顯示信息只為說明職工已按名字排序,該部分可刪除*/printf("-n");printf("No.tworker'agettworker'namen");for(i=0;i<n;i+)printf("%dt%dttt%sn",

23、(F1+i*sizeof(WORKERBASIC)->No,(F1+i*sizeof(WORKERBASIC)->age,(F1+i*sizeof(WORKERBASIC)->name);printf("-n");printf("nPlease input a worker you want to exactly search: ");scanf("%s",str);getchar();low=0;/*折半法*/high=n-1;while(low<=high)&&(flag=0)mid=(lo

24、w+high)/2;if (strcmp( str, (F1+mid*sizeof(WORKERBASIC)->name )>0)low=mid+1;else if (strcmp( str, (F1+mid*sizeof(WORKERBASIC)->name )<0)high=mid-1;else if (strcmp( str, (F1+mid*sizeof(WORKERBASIC)->name )=0)flag=1;if (flag=0)printf("can not find the worker!n");elseprintf(&quo

25、t;-n");printf("No.tworker'agettworker'namen");printf("%dt%dttt%sn",(F1+mid*sizeof(WORKERBASIC)->No,(F1+mid*sizeof(WORKERBASIC)->age,(F1+mid*sizeof(WORKERBASIC)->name);printf("-n");PrintPause();return 0;int EditByage(WORKERBASIC *F1,int n)/*按年齡查找*/i

26、nt a,flag=0,i;printf("-n");printf("No.tworker'agettworker'namen");for(i=0;i<n;i+)printf("%dt%dttt%sn",(F1+i*sizeof(WORKERBASIC)->No,(F1+i*sizeof(WORKERBASIC)->age,(F1+i*sizeof(WORKERBASIC)->name);printf("-n");printf("nPlease input work

27、er'age: ");scanf("%d",&a);getchar();for(i=0;i<n;i+)if (a=(F1+i*sizeof(WORKERBASIC)->age)if(flag=0)printf("-n");printf("No.tworker'agettworker'namen");flag=1;printf("%dt%dttt%sn",(F1+i*sizeof(WORKERBASIC)->No,(F1+i*sizeof(WORKERBAS

28、IC)->age,(F1+i*sizeof(WORKERBASIC)->name);if (flag=0)printf("can not find the worker!n");elseprintf("-n");PrintPause();return 0;int Edit()/*查找*/WORKERBASIC load,*F1;int n=0,key=0,i;FILE *fp=NULL;cleanscreen();if (fp=fopen("wenjian.txt","rb")=NULL)printf(

29、"can not find wenjian!n");PrintPause();return 0;while(!feof(fp)/*統(tǒng)計(jì)職工的數(shù)量*/if (fread(&load,sizeof(WORKERBASIC),1,fp)=1)n+;fclose(fp);if (n=0)printf("No information of worker!n");PrintPause();return 0;F1=(WORKERBASIC *)malloc(n*sizeof(WORKERBASIC);/*按職工的人數(shù)申請內(nèi)存空間*/fp=fopen("

30、;wenjian.txt","rb");for(i=0;i<n;i+)if (fread(F1+i*sizeof(WORKERBASIC),sizeof(WORKERBASIC),1,fp)!=1)printf("read failed!n");PrintPause();return 0;fclose(fp);while(key!=ESC)clrscr();printf("Please select search method:n");printf("-n");printf("1t=By

31、No.n");printf("2t=By Name.n");printf("3t=By age.n");printf("Esct=Exitn");printf("-n");printf("Press 1 2 3 or Esc?n");key=getch();switch(key)case '1':key=EditByNo(F1,n);break;case '2':key=EditByName(F1,n);break;case '3':ke

32、y=EditByage(F1,n);break;free(F1);return 0;int Modify()/*修改*/WORKER *head=NULL,*t=NULL,*load=NULL;FILE *fp=NULL;char str20;int num;cleanscreen();load=(WORKER *)malloc(sizeof(WORKER);if(fp=fopen("wenjian.txt","rb")=NULL)printf("can not find wenjian!n");PrintPause();return

33、 0;head=t=load;if (fread(load,sizeof(WORKERBASIC),1,fp)!=1)printf("load failed!n");PrintPause();return 0;while(!feof(fp)load=(WORKER *)malloc(sizeof(WORKER);t->next=load;if (fread(load,sizeof(WORKERBASIC),1,fp)!=1)break;t=load;t->next=NULL;/*創(chuàng)建鏈表完成*/fclose(fp);t=head;Scan();printf(&q

34、uot;nWhich worker do you want to modify?n");printf("Please input the No. age. or name: ");scanf("%s",str);getchar();num=atoi(str);/*把字符串轉(zhuǎn)換為長整型數(shù)*/if (strcmp(t->,str)=0)|(num=t->workerinfo.No)|(num=t->workerinfo.age)printf("nPlease input the new No

35、. ");scanf("%d",&t->workerinfo.No);getchar();printf("nPlease input the new age. ");scanf("%d",&t->workerinfo.age);getchar();printf("nPlease input the new name: ");scanf("%s",t->);getchar();printf("Modify Succ

36、ess!n");fp=fopen("wenjian.txt","wb");t=head;if (head!=NULL)fwrite(t,sizeof(WORKERBASIC),1,fp);while(t->next!=NULL)t=t->next;if(fwrite(t,sizeof(WORKERBASIC),1,fp)!=1)printf("add failed!n");PrintPause();break;free(head);fclose(fp);PrintPause();return 0;/*存入文件(目

37、標(biāo)在首地址)*/while(t->next!=NULL)t=t->next;if (strcmp(t->,str)=0)|(num=t->workerinfo.No)|(num=t->workerinfo.age)printf("nPlease input the new No. ");scanf("%d",&t->workerinfo.No);getchar();printf("nPlease input the new age. ");scanf("

38、;%d",&t->workerinfo.age);getchar();printf("nPlease input the new name: ");scanf("%s",t->);getchar();printf("Modify Success!n");fp=fopen("wenjian.txt","wb");t=head;if (head!=NULL)fwrite(t,sizeof(WORKERBASIC),1,fp);while(t

39、->next!=NULL)t=t->next;if(fwrite(t,sizeof(WORKERBASIC),1,fp)!=1)printf("add failed!n");PrintPause();break;/*存入文件(當(dāng)不在首地址的時(shí)候)*/free(head);fclose(fp);PrintPause();return 0;printf("Input Wrong!n");PrintPause();return 0;int Delete()/*刪除*/WORKER *head=NULL,*t=NULL,*load=NULL,*b=N

40、ULL;FILE *fp=NULL;int num;char str20,ch;cleanscreen();load=(WORKER *)malloc(sizeof(WORKER);if(fp=fopen("wenjian.txt","rb")=NULL)printf("can not find wenjian!n");PrintPause();return 0;head=t=load;if (fread(load,sizeof(WORKERBASIC),1,fp)!=1)printf("load failed!n"

41、;);PrintPause();return 0;while(!feof(fp)load=(WORKER *)malloc(sizeof(WORKER);t->next=load;if (fread(load,sizeof(WORKERBASIC),1,fp)!=1)break;t=load;t->next=NULL;fclose(fp);t=head;Scan();printf("nWhich worker do you want to delete?n");printf("Please input the No. age or name: &quo

42、t;);scanf("%s",str);getchar();num=atoi(str);if (strcmp(t->,str)=0)|(num=t->workerinfo.No)|(num=t->workerinfo.age)printf("nDo you really want to delete %s?(Press 'y' to sure)n",t->);if (ch=getch()!='y')return 0;head=t->n

43、ext;free(t);printf("Delete Success!n");fp=fopen("wenjian.txt","wb");t=head;if (head!=NULL)fwrite(t,sizeof(WORKERBASIC),1,fp);while(t->next!=NULL)t=t->next;if(fwrite(t,sizeof(WORKERBASIC),1,fp)!=1)printf("add failed!n");PrintPause();break;free(head);fclos

44、e(fp);PrintPause();return 0;while(t->next!=NULL)t=b;t=t->next;if (strcmp(t->,str)=0)|(num=t->workerinfo.No)|(num=t->workerinfo.age)printf("nDo you really want to delete %s?(Press 'y' to sure)n",t->);if (ch=getch()!='y')return

45、0;b->next=t->next;free(t);printf("Delete Success!n");fp=fopen("wenjian.txt","wb");t=head;if (head!=NULL)fwrite(t,sizeof(WORKERBASIC),1,fp);while(t->next!=NULL)t=t->next;if(fwrite(t,sizeof(WORKERBASIC),1,fp)!=1)printf("add failed!n");PrintPause();br

46、eak;free(head);fclose(fp);PrintPause();return 0;b=b->next;printf("Input Wrong!n");PrintPause();return 0;int Into() /*鏈表插入*/WORKER *head=NULL,*t=NULL,*load=NULL,*b=NULL,*a=NULL;FILE *fp=NULL;int num;char str20,ch;cleanscreen();load=(WORKER *)malloc(sizeof(WORKER);if(fp=fopen("wenjia

47、n.txt","rb")=NULL)printf("can not find wenjian!n");PrintPause();return 0;head=t=load;if (fread(load,sizeof(WORKERBASIC),1,fp)!=1)printf("load failed!n");PrintPause();return 0;while(!feof(fp)load=(WORKER *)malloc(sizeof(WORKER);t->next=load;if (fread(load,sizeof(

48、WORKERBASIC),1,fp)!=1)break;t=load;t->next=NULL;fclose(fp);t=head;Scan();a=(WORKER *)malloc(sizeof(WORKER);printf("ninput new worker's No.");scanf("%d",&a->workerinfo.No);getchar();printf("nPlease input the new age. ");scanf("%d",&a->worke

49、rinfo.age);getchar();printf("input new worker's name:");scanf("%s",a->);getchar();printf("nwhere do you want to add?n");printf("Please input the No. age. or name: ");scanf("%s",str);getchar();num=atoi(str);if (strcmp(t->worke

50、,str)=0)|(num=t->workerinfo.No)|(num=t->workerinfo.age)printf("nDo you really want to add before %s?(Press 'y' to sure)n",t->);if (ch=getch()!='y')return 0;a->next=t;printf("Into Success!n");fp=fopen("wenjian.txt",&qu

51、ot;wb");head=t=a;if (head!=NULL)fwrite(t,sizeof(WORKERBASIC),1,fp);while(t->next!=NULL)t=t->next;if(fwrite(t,sizeof(WORKERBASIC),1,fp)!=1)printf("add failed!n");PrintPause();break;free(head);fclose(fp);PrintPause();return 0;while(t->next!=NULL)t=t->next;if (strcmp(t->,str)=0)|(num=t->workerinfo.No)|(num=t->workerinfo.age)printf("nDo you really want to add after %s?(Press 'y

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論