欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      C語言實(shí)驗(yàn)電話薄管理系統(tǒng)

      時(shí)間:2019-05-14 07:36:05下載本文作者:會員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關(guān)的《C語言實(shí)驗(yàn)電話薄管理系統(tǒng)》,但愿對你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《C語言實(shí)驗(yàn)電話薄管理系統(tǒng)》。

      第一篇:C語言實(shí)驗(yàn)電話薄管理系統(tǒng)

      #include “stdio.h” /*標(biāo)準(zhǔn)輸入輸出函數(shù)庫*/ #include “stdlib.h” /*標(biāo)準(zhǔn)函數(shù)庫*/ #include “string.h” /*字符串函數(shù)庫*/ #include “conio.h” /*屏幕操作函數(shù)庫*/ #define HEADER1

      ---------------------------TELEPHONE BOOK---------------------------n” #define HEADER2 “ | num | name | phonenumber | address | n” #define

      HEADER3

      “ |--------------|------------|-----------------|---------------------| n” #define FORMAT “ | %-10s| %-10s| %-15s |%-20s | n” #define DATA p->num,p->name,p->phonenum,p->address #define

      END

      “-------n” #define N 100 int saveflag=0;/*是否需要存盤的標(biāo)志變量*/ /*定義與電話簿有關(guān)的數(shù)據(jù)結(jié)構(gòu)*/ typedef struct telebook /*標(biāo)記為telebook*/ { char num[4];/*編號*/ char name[10];/*姓名*/ char phonenum[15];/*電話號碼*/ char address[20];/*地址*/ }TELEBOOK;

      void menu()/*主菜單*/ { system(“cls”);/*調(diào)用DOS命令,清屏.與clrscr()功能相同*/ textcolor(13);/*在文本模式中選擇新的字符顏色*/ gotoxy(10,5);/*在文本窗口中設(shè)置光標(biāo)*/ cprintf(“ The telephone-book Management System n”);gotoxy(10,8);cprintf(“ *************************Menu********************************n”);gotoxy(10,9);cprintf(“ * 1 input record 2 display record *n”);gotoxy(10,10);cprintf(“ * 3 delete record 4 search record *n”);gotoxy(10,11);cprintf(“ * 5 modify record 6 insert record *n”);gotoxy(10,12);cprintf(“ * 7 sort record 8 save record *n”);gotoxy(10,13);cprintf(“ * 0 quit system *n”);gotoxy(10,14);cprintf(“ *************************************************************n”);/*cprintf()送格式化輸出至文本窗口屏幕中*/ } /*格式化輸出表頭*/ void printheader(){ printf(HEADER1);printf(HEADER2);printf(HEADER3);} /*格式化輸出表中數(shù)據(jù)*/ void printdata(TELEBOOK pp){ TELEBOOK* p;p=&pp;printf(FORMAT,DATA);}

      /*顯示數(shù)組temp[]中存儲的電話簿記錄,內(nèi)容為telebook結(jié)構(gòu)中定義的內(nèi)容*/ void Disp(TELEBOOK temp[],int n){ int i;if(n==0)/*表示沒有電話簿記錄*/ { printf(“n=====>Not telephone record!n”);getchar();return;}

      printf(“nn”);printheader();/*輸出表格頭部*/ i=0;while(i

      void Wrong()/*輸出按鍵錯誤信息*/ { printf(“nnnnn***********Error:input has wrong!press any key to continue**********n”);getchar();}

      void Nofind()/*輸出未查找此記錄的信息*/ { printf(“n=====>Not find this telephone record!n”);}

      /************************************************************* 作用:用于定位數(shù)組中符合要求的記錄,并返回保存該記錄的數(shù)組元素下標(biāo)值

      參數(shù):findmess[]保存要查找的具體內(nèi)容;nameorphonenum[]保存按什么在數(shù)組中查找;**************************************************************/ int Locate(TELEBOOK temp[],int n,char nameorphonenum[]){ int i=0;if(strcmp(nameorphonenum,“phonenum”)==0)/*按電話號碼查詢*/ { while(i

      findmess[],char return i;i++;} } return-1;/*若未找到,返回一個整數(shù)-1*/ }

      /*輸入字符串,并進(jìn)行長度驗(yàn)證(長度lens)printf(“n exceed the required length!n”);/*進(jìn)行長度校驗(yàn),超過lens值重新輸入*/ }while(strlen(n)>lens);strcpy(t,n);/*將輸入的字符串拷貝到字符串t中*/ } /*增加電話簿記錄*/ int Add(TELEBOOK temp[],int n){ char ch,num[10];int i,flag=0;system(“cls”);Disp(temp,n);/*先打印出已有的電話簿信息*/

      while(1)/*一次可輸入多條記錄,直至輸入編號為0的記錄才結(jié)束添加操作*/ { while(1)/*輸入記錄編號,保證該編號沒有被使用,若輸入編號為0,則退出添加記錄操作*/ { stringinput(num,10,“input number(press '0'return menu):”);/*格式化輸入編號并檢驗(yàn)*/ flag=0;if(strcmp(num,“0”)==0)/*輸入為0,則退出添加操作,返回主界面*/ {return n;} i=0;while(i

      if(flag==1)/*提示用戶是否重新輸入*/ { getchar();printf(“==>The number %s is existing,try again?(y/n):”,num);scanf(“%c”,&ch);if(ch=='y'||ch=='Y')continue;else return n;} else {break;} } strcpy(temp[n].num,num);/*將字符串numtemp[n].num中*/ stringinput(temp[n].name,15,“Name:”);stringinput(temp[n].phonenum,15,“Telephone:”);stringinput(temp[n].address,15,“Adress:”);saveflag=1;n++;} return n;}

      /*按編號或姓名,查詢電話簿記錄*/ void Qur(TELEBOOK temp[],int n){

      拷貝到int select;/*1:按姓名查,2:按電話號碼查,其他:返回主界面(菜單)*/ char searchinput[20];/*保存用戶輸入的查詢內(nèi)容*/ int p=0;if(n<=0)/*若數(shù)組為空*/ { system(“cls”);printf(“n=====>No telephone record!n”);getchar();return;} system(“cls”);printf(“n =====>1 Search by name =====>2 Search by telephone numbern”);printf(“ please choice[1,2]:”);scanf(“%d”,&select);if(select==1)/*按姓名查詢*/ {

      stringinput(searchinput,10,“input the existing name:”);p=Locate(temp,n,searchinput,“name”);/*在數(shù)組temp中查找編號為searchinput值的元素,并返回該數(shù)組元素的下標(biāo)值*/ if(p!=-1)/*若找到該記錄*/ { printheader();printdata(temp[p]);printf(END);printf(“press any key to return”);getchar();} else Nofind();getchar();} else if(select==2)/*按電話號碼查詢*/ { stringinput(searchinput,15,“input the

      existing number:”);p=Locate(temp,n,searchinput,“phonenum”);if(p!=-1){ printheader();printdata(temp[p]);printf(END);printf(“press any key to return”);getchar();} else Nofind();getchar();}

      telephone else Wrong();getchar();}

      /*刪除電話簿記錄:先找到保存該記錄的數(shù)組元素的下標(biāo)值,然后在數(shù)組中刪除該數(shù)組元素*/ int Del(TELEBOOK temp[],int n){ int sel;char findmess[20];int p=0,i=0;if(n<=0){ system(“cls”);printf(“n=====>No telephone record!n”);getchar();return n;} system(“cls”);Disp(temp,n);printf(“n =====>1 Delete by name =====>2 Delete by

      telephone numbern”);printf(“ please choice[1,2]:”);scanf(“%d”,&sel);if(sel==1){ stringinput(findmess,10,“input the existing name:”);p=Locate(temp,n,findmess,“name”);getchar();if(p!=-1){ for(i=p+1;i

      strcpy(temp[i-1].num,temp[i].num);strcpy(temp[i-1].name,temp[i].name);strcpy(temp[i-1].phonenum,temp[i].phonenum);strcpy(temp[i-1].address,temp[i].address);} printf(“n==>delete success!n”);n--;getchar();saveflag=1;} else Nofind();getchar();} else if(sel==2)/*先按電話號碼查詢到該記錄所在的數(shù)組元素的下標(biāo)值*/ { stringinput(findmess,15,“input number:”);p=Locate(temp,n,findmess,“phonenum”);getchar();if(p!=-1){ for(i=p+1;i

      strcpy(temp[i-1].num,temp[i].num);strcpy(temp[i-1].name,temp[i].name);strcpy(temp[i-1].phonenum,temp[i].phonenum);strcpy(temp[i-1].address,temp[i].address);} printf(“n=====>delete success!n”);

      the

      existing

      telephone n--;getchar();saveflag=1;} else Nofind();getchar();} return n;}

      /*修改電話簿記錄。先按輸入的聯(lián)系人姓名查詢到該記錄,然后提示用戶修改該記錄編號之外的值,編號不能修改*/ void Modify(TELEBOOK temp[],int n){ char findmess[20];int p=0;if(n<=0){ system(“cls”);printf(“n=====>No telephone number record!n”);getchar();return;} system(“cls”);printf(“modify telephone book recorder”);Disp(temp,n);stringinput(findmess,10,“input the existing name:”);/*輸入并檢驗(yàn)該姓名*/ p=Locate(temp,n,findmess,“name”);/*查詢到該數(shù)組元素,并返回下標(biāo)值*/ if(p!=-1)/*若p!=-1,表明已經(jīng)找到該數(shù)組元素*/ { printf(“Number:%s,n”,temp[p].num);printf(“Name:%s,”,temp[p].name);stringinput(temp[p].name,15,“input new name:”);

      printf(“Name:%s,”,temp[p].phonenum);stringinput(temp[p].phonenum,15,“input new telephone:”);

      printf(“Name:%s,”,temp[p].address);stringinput(temp[p].address,30,“input new address:”);

      printf(“n=====>modify success!n”);getchar();Disp(temp,n);getchar();saveflag=1;} else {Nofind();getchar();} return;}

      /*插入記錄:按編號查詢到要插入的數(shù)組元素的位置,然后在該記錄編號之后插入一個新數(shù)組元素。*/ int Insert(TELEBOOK temp[],int n){ char ch,num[10],s[10];/*s[]保存插入點(diǎn)位置之前的記錄編號,num[]保存輸入的新記錄的編號*/ TELEBOOK newinfo;int flag=0,i=0,kkk=0;system(“cls”);Disp(temp,n);while(1){ stringinput(s,10,“please input insert location after the Number:”);flag=0;i=0;while(iThe again?(y/n):”,s);scanf(“%c”,&ch);if(ch=='y'||ch=='Y'){continue;} else {return n;} } } /*以下新記錄的輸入操作與Add()相同*/

      number

      %s

      is

      not

      existing,try while(1){ stringinput(num,10,“input new Number:”);i=0;flag=0;while(iSorry,The again?(y/n):”,num);scanf(“%c”,&ch);if(ch=='y'||ch=='Y'){continue;} else {return n;} } else break;

      number

      %s

      is

      existing,try }

      strcpy(newinfo.num,num);/*將字符串numnewinfo.num中*/ stringinput(newinfo.name,15,“Name:”);stringinput(newinfo.phonenum,15,“Telephone:”);stringinput(newinfo.address,15,“Adress:”);

      saveflag=1;/*在main()有對該全局變量的判斷,若為1,則進(jìn)行存盤操作*/

      for(i=n-1;i>kkk;i--)/*從最后一個組織元素開始往向移一個元素位置*/ { strcpy(temp[i+1].num,temp[i].num);strcpy(temp[i+1].name,temp[i].name);strcpy(temp[i+1].phonenum,temp[i].phonenum);strcpy(temp[i+1].address,temp[i].address);} strcpy(temp[kkk+1].num,newinfo.num);/*在kkk的元素位置后插入新記錄*/ strcpy(temp[kkk+1].name,newinfo.name);

      拷貝到strcpy(temp[kkk+1].phonenum,newinfo.phonenum);strcpy(temp[kkk+1].address,newinfo.address);n++;Disp(temp,n);printf(“nn”);getchar();return n;}

      /*利用選擇排序法實(shí)現(xiàn)數(shù)組的按記錄編號或姓名的升序排序*/ void SelectSort(TELEBOOK temp[],int n){ int i=0,j=0,flag=0,indexmin,select;char charflag[10];TELEBOOK newinfo;if(n<=0){ system(“cls”);printf(“n=====>Not telephone record!n”);getchar();return;} system(“cls”);Disp(temp,n);/*顯示排序前的所有記錄*/ printf(“ ==>1 SORT BY NUMBER ==>2 SORT BY NAMEn”);printf(“ please choice[1,2]:”);scanf(“%d”,&select);if(select==1)/*按記錄編號排序*/ { for(i=0;i

      strcpy(temp[i].num,temp[indexmin].num);strcpy(temp[i].name,temp[indexmin].name);strcpy(temp[i].phonenum,temp[indexmin].phonenum);strcpy(temp[i].address,temp[indexmin].address);

      strcpy(temp[indexmin].num,newinfo.num);strcpy(temp[indexmin].name,newinfo.name);strcpy(temp[indexmin].phonenum,newinfo.phonenum);strcpy(temp[indexmin].address,newinfo.address);} Disp(temp,n);/*顯示排序后的所有記錄*/ saveflag=1;printf(“n =====>sort complete!n”);getchar();return;} else if(select==2){ for(i=0;i0){ charflag[0]=temp[j].name;indexmin=j;} } strcpy(newinfo.num,temp[i].num);/*利用結(jié)構(gòu)變量newinfo實(shí)現(xiàn)數(shù)組元素的交換*/ strcpy(newinfo.name,temp[i].name);strcpy(newinfo.phonenum,temp[i].phonenum);strcpy(newinfo.address,temp[i].address);

      strcpy(temp[i].num,temp[indexmin].num);strcpy(temp[i].name,temp[indexmin].name);strcpy(temp[i].phonenum,temp[indexmin].phonenum);strcpy(temp[i].address,temp[indexmin].address);

      strcpy(temp[indexmin].num,newinfo.num);strcpy(temp[indexmin].name,newinfo.name);strcpy(temp[indexmin].phonenum,newinfo.phonenum);strcpy(temp[indexmin].address,newinfo.address);} Disp(temp,n);/*顯示排序后的所有記錄*/ saveflag=1;printf(“n =====>sort complete!n”);getchar();return;} else {Wrong();getchar();getchar();return;} }

      /*數(shù)據(jù)存盤,若用戶沒有專門進(jìn)行此操作且對數(shù)據(jù)有修改,在退出系統(tǒng)時(shí),會提示用戶存盤*/ void Save(TELEBOOK temp[],int n){ FILE* fp;int i=0;fp=fopen(“c: elephon”,“w”);/*以只寫方式打開文本文件*/ if(fp==NULL)/*打開文件失敗*/ { printf(“n=====>open file error!n”);getchar();return;} for(i=0;i0){ getchar();printf(“nn=====>save file complete,total saved's record number is:%dn”,i);getchar();saveflag=0;} else {system(“cls”);printf(“the current link is empty,no telephone saved!n”);getchar();} fclose(fp);/*關(guān)閉此文件*/ }

      void main(){ TELEBOOK tele[N];/*定義TELEBOOK結(jié)構(gòu)體*/ FILE *fp;/*文件指針*/ int select;/*保存選擇結(jié)果變量*/ char ch;/*保存(y,Y,n,N)*/

      is record int count=0;/*保存文件中的記錄條數(shù)(或元素個數(shù))*/

      fp=fopen(“C: elephon”,“a+”);/*以追加方式打開文本文件c:telephon,可讀可寫,若此文件不存在,會創(chuàng)建此文件*/ if(fp==NULL){ printf(“n=====>can not open file!n”);exit(0);}

      while(!feof(fp)){ if(fread(&tele[count],sizeof(TELEBOOK),1,fp)==1)/*一次從文件中讀取一條電話簿記錄*/ count++;} fclose(fp);/*關(guān)閉文件*/ printf(“n==>open file sucess,the total records number is : %d.n”,count);getchar();menu();while(1){ system(“cls”);menu();printf(“n Please Enter your choice(0~8):”);/*顯示提示信息*/ scanf(“%d”,&select);

      if(select==0){ if(saveflag==1)/*若對數(shù)組的數(shù)據(jù)有修改且未進(jìn)行存盤操作,則此標(biāo)志為1*/ { getchar();printf(“n==>Whether save the modified record to file?(y/n):”);scanf(“%c”,&ch);if(ch=='y'||ch=='Y')Save(tele,count);} printf(“n===>thank you for useness!”);getchar();break;} switch(select){ case 1:count=Add(tele,count);break;/*增加電話簿記錄*/ case 2:system(“cls”);Disp(tele,count);break;/*顯示電話簿記錄*/ case 3:count=Del(tele,count);break;/*刪除電話簿記錄*/ case 4:Qur(tele,count);break;/*查詢電話簿記錄*/ case 5:Modify(tele,count);break;/*修改電話簿記錄*/ case 6:count=Insert(tele,count);break;/*插入電話簿記錄*/ case 7:SelectSort(tele,count);break;/*排序電話簿記錄*/ case 8:Save(tele,count);break;/*保存電話簿記錄*/ default: Wrong();getchar();break;/*按鍵有誤,必須為數(shù)值0-9*/ } } }

      第二篇:圖書管理系統(tǒng)實(shí)驗(yàn)范文

      小型圖書管理系統(tǒng)

      試驗(yàn)?zāi)康牟捎肅/S模式完成一個小型的圖書管理系統(tǒng);完成需求分析所有流程。問題及算法描述

      完成一個小型圖書管理系統(tǒng),功能要求如下:

      1)能夠通過書籍基本信息(包括:書號、書名、出版社、出版日期、作者、內(nèi)容摘要)單個或以AND方式組合多個條件查詢書籍信息;

      2)對于每一種書籍,除可查看其基本信息之外還可查看其總數(shù)以及目前在館數(shù)量

      3)可增添新的書籍

      4)可刪除已有書籍(如有讀者借了該書籍尚未歸還,則不允許刪除)

      5)可修改書籍的基本信息

      6)能夠通過讀者基本信息(包括:證號、姓名、性別、系名、年級)單個或以AND方式組合多個條件查詢讀者信息

      7)對于每位讀者除可查看其基本信息之外,還可查看其已借的書籍列表、數(shù)量、借還日期

      8)可增添新的讀者

      9)可刪除已有讀者(如該讀者有尚未歸還的借書,則不允許刪除)

      10)可修改讀者的基本信息

      11)可完成借還書籍的手續(xù)

      12)還書時(shí)如超期,應(yīng)該顯示超期天數(shù)

      13)借書時(shí)如果有超期的書沒有還,則不允許借書

      14)可查詢有哪些讀者有超期的書沒有還,列出這些讀者的基本信息 結(jié)果要求

      實(shí)驗(yàn)的目的實(shí)驗(yàn)簡述

      可行性研究文檔

      需求分析文檔(數(shù)據(jù)模型、功能模型、行為模型)

      總體設(shè)計(jì)文檔

      詳細(xì)設(shè)計(jì)文檔

      實(shí)現(xiàn)文檔(不含程序界面及代碼)

      第三篇:C語言學(xué)生管理系統(tǒng)綜合性實(shí)驗(yàn)題目

      “學(xué)生管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)”綜合性實(shí)驗(yàn)

      實(shí)驗(yàn)名稱:學(xué)生管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)

      實(shí)驗(yàn)類型:綜合性實(shí)驗(yàn)

      一、實(shí)驗(yàn)?zāi)康膹?qiáng)化學(xué)生對C語言的基本語法和基本編程技能的熟練掌握,并在此基礎(chǔ)上,重點(diǎn)培養(yǎng)學(xué)生對實(shí)際應(yīng)用問題進(jìn)行抽象分析的能力和綜合運(yùn)用C語言知識進(jìn)行具體實(shí)現(xiàn)的編程能力。

      二、實(shí)驗(yàn)內(nèi)容

      綜合應(yīng)用C語言中講授的流程控制語句、模塊化程序設(shè)計(jì)方法(函數(shù))和豐富的數(shù)據(jù)類型(指針、數(shù)組、結(jié)構(gòu)體等)完成“學(xué)生管理系統(tǒng)”的設(shè)計(jì)與實(shí)現(xiàn)。

      三、實(shí)驗(yàn)環(huán)境

      Windows XP系統(tǒng),C語言開發(fā)環(huán)境:Win-TC、Turbo C3.0、VC等。

      四、實(shí)驗(yàn)要求

      1、總體要求:系統(tǒng)功能齊全,運(yùn)行結(jié)果正確,用戶界面友好,使用簡單方便。

      2、系統(tǒng)數(shù)據(jù)要求:學(xué)生信息如下:學(xué)號、姓名、年齡、所在系、3門課程名稱及成績、總分、平均分。

      3、系統(tǒng)功能要求:

      ⑴輸入至少10個學(xué)生的自然信息(學(xué)號、姓名、年齡、所在系、成績)。

      ⑵計(jì)算每個學(xué)生的總分、平均分,并輸出每個學(xué)生的學(xué)號,姓名,總分,平均分。

      ⑶根據(jù)學(xué)生的總分進(jìn)行排序輸出。

      ⑷針對課程不同科目進(jìn)行排序輸出。

      ⑸統(tǒng)計(jì)輸出每門課程的平均分。

      ⑹實(shí)現(xiàn)多種查詢功能(例如:根據(jù)學(xué)號或姓名或所在系等,查詢一個或多個學(xué)生信息)。

      ⑺對于已輸入的學(xué)生信息進(jìn)行儲存。

      ⑻能實(shí)現(xiàn)學(xué)生信息的增、刪、改操作。

      五、實(shí)驗(yàn)結(jié)果

      實(shí)驗(yàn)完成要求上交全部源程序代碼(包括存盤數(shù)據(jù))和完整的綜合性實(shí)驗(yàn)報(bào)告(包括系統(tǒng)設(shè)計(jì)、實(shí)驗(yàn)過程中出現(xiàn)問題的分析與修改、代碼打印、運(yùn)行結(jié)果拷屏打印)。

      六、考核形式

      考查。根據(jù)上機(jī)出勤、實(shí)驗(yàn)報(bào)告及完成的程序系統(tǒng)進(jìn)行評價(jià),分為優(yōu)、良、中、及格、不及格。

      第四篇:c語言 電話簿管理系統(tǒng)

      #include “stdio.h” #include “string.h” #define N 20 struct mem { char name[20];

      char tel[20];

      char wu[20];

      char dz[20];}mem[N];void sorttel(struct mem tel[]){

      struct mem temp;

      int i,j;

      FILE *fp;if((fp=fopen(“c: elephone.txt”,“rb”))==NULL){

      printf(“不能打開文件n”);} for(i=0;i

      for(j=0;j

      if(strcmp(mem[j+1].tel,mem[j].tel)<0)

      {

      temp=mem[j];

      mem[j]=mem[j+1];

      mem[j+1]=temp;

      } for(i=0;i

      void sortname(struct mem tel[]){

      struct mem temp;

      int i,j;

      FILE *fp;if((fp=fopen(“c: elephone.txt”,“rb”))==NULL){

      printf(“不能打開文件n”);} for(i=0;i

      for(j=i+1;j

      if(strcmp(mem[j].name,mem[i].name)<0)

      {

      temp=mem[i];

      mem[i]=mem[j];

      mem[j]=temp;

      } for(i=0;i

      void sor(){int k;

      do{printf(“--------------------排序菜單-------------------n”);

      printf(“------------------------n”);

      printf(“

      1:按號碼排序n”);

      printf(“

      2:按姓名排序n”);

      printf(“

      0:退出n”);

      printf(“------------------------n”);

      printf(“請輸入0-2選擇功能n”);

      scanf(“%d”,&k);getchar();

      switch(k)

      {

      case 1:sorttel(mem);break;

      case 2:sortname(mem);break;

      case 0:return;

      }

      }while(1);}

      void add(){ char name[10];char tel[10];

      char wu[10];

      char dz[10];FILE *fp;if((fp=fopen(“c: elephone.txt”,“a”))==NULL){

      printf(“不能打開文件n”);

      exit(0);}

      printf(“請輸入姓名”);

      gets(name);

      printf(“請輸入電話號碼”);

      gets(tel);

      printf(“請輸入工作單位”);

      gets(wu);

      printf(“請輸入地址”);

      gets(dz);printf(“n”);

      fprintf(fp,“%s %s %s %sn”,name,tel,wu,dz);

      fclose(fp);} void del(){

      FILE *fp;

      int i=0,n;

      char name[10];

      printf(“請輸入刪除名字”);

      gets(name);

      if((fp=fopen(“c: elephone.txt”,“r”))==NULL){

      printf(“不能打開文件n”);

      exit(0);}

      while(!feof(fp))

      {

      fscanf(fp,“%s%s%s%s”,mem[i].name,mem[i].tel,mem[i].wu,mem[i].dz);

      if(strcmp(name,mem[i].name)!=0)i++;

      }

      fclose(fp);if((fp=fopen(“c: elephone.txt”,“w”))==NULL){

      printf(“不能打開文件n”);

      exit(0);} for(n=0;n

      fprintf(fp,“%s %s %s %s”,mem[n].name,mem[n].tel,mem[n].wu,mem[n].dz);fclose(fp);} void dis(){ FILE * fp;int i=0,n;printf(“

      姓名

      電話號碼

      工作單位

      地址n”);

      if((fp=fopen(“c: elephone.txt”,“r”))==NULL){

      printf(“不能打開文件n”);

      exit(0);}

      while(!feof(fp))

      {fscanf(fp,“%s%s%s%s”,mem[i].name,mem[i].tel,mem[i].wu,mem[i].dz);i++;}

      fclose(fp);

      n=i;

      for(i=0;i

      printf(“%-8s%11s%13s%24sn”,mem[i].name,mem[i].tel,mem[i].wu,mem[i].dz);} void mod(){ FILE * fp;int i=0,n;char name[10];char nn[10];char nt[10];char nwu[10];char ndz[10];

      printf(“請輸入要修改的姓名”);gets(name);printf(“請輸入修改后的姓名”);gets(nn);printf(“請輸入修改后的電話號碼”);gets(nt);printf(“請輸入修改后的工作單位”);gets(nwu);printf(“請輸入修改后的地址”);gets(ndz);printf(“n”);if((fp=fopen(“c: elephone.txt”,“r”))==NULL){

      printf(“不能打開文件n”);

      exit(0);}

      while(!feof(fp))

      {

      fscanf(fp,“%s%s%s%s”,mem[i].name,mem[i].tel,mem[i].wu,mem[i].dz);

      if(strcmp(name,mem[i].name)==0)

      {strcpy(mem[i].name,nn);strcpy(mem[i].tel,nt);strcpy(mem[i].wu,nwu);strcpy(mem[i].dz,ndz);}

      i++;

      }

      fclose(fp);if((fp=fopen(“c: elephone.txt”,“w”))==NULL){

      printf(“不能打開文件n”);

      exit(0);}

      n=i;

      for(i=0;i

      fprintf(fp,“%s %s %s %sn”,mem[i].name,mem[i].tel,mem[i].wu,mem[i].dz);

      fclose(fp);} void main(){

      int choose;

      while(1)

      {

      printf(“--------------------電話簿管理系統(tǒng)--------------------n”);

      printf(“------------------------n”);

      printf(“

      1:添加一個新號碼n”);

      printf(“

      2:刪除一個號碼n”);

      printf(“

      3:顯示所有保存的號碼n”);

      printf(“

      4:修改號碼n”);

      printf(“

      5:排序n”);

      printf(“

      6:查詢n”);

      printf(“

      0:退出n”);

      printf(“------------------------n”);

      printf(“請輸入0-6選擇功能n”);

      scanf(“%d”,&choose);getchar();

      if(choose!=0)

      switch(choose)

      {

      case 1:add();break;

      case 2:del();break;

      case 3:dis();break;

      case 4:mod();break;

      case 5:sor();break;

      case 6:/*que();break*/;

      }

      else exit(0);

      } }

      第五篇:C語言-通訊錄管理系統(tǒng)

      #include #include #include struct record{ charnum[12];char name[10];char birthday[10];char post[10];char phone[15];}data[100];intmenu_select();intcreate_record();intadd_record(int flag);int flag=0;

      intfind_record(int flag);intdelete_record(int flag);voidpaixu_record(int flag);intsave_record(int flag);void main(){ for(;;){ switch(menu_select())

      { case 1: printf(“ ***********************************************n”);printf(“ ************** 通訊錄的建立 ***************n”);printf(“ ***********************************************n”);flag=create_record();break;case 2: printf(“ ***********************************************n”);printf(“ ************** 通訊錄信息的添加 *****************n”);printf(“ ***********************************************n”);flag=add_record(flag);break;case 3: printf(“ ******************************n”);printf(“ ******* 通訊錄信息查詢 *******n”);printf(“ ******************************n”);find_record(flag);

      break;case 4: printf(“ ***********************************n”);printf(“ **********通訊信息的刪除***********n”);printf(“ ***********************************n”);delete_record(flag);break;case 5: printf(“ ***********************************n”);printf(“ **********通訊錄的存儲(D:)*********n”);printf(“ ***********************************n”);save_record(flag);break;case 6: printf(“ ***********************************n”);printf(“ **********通訊者的排序*********n”);printf(“ ***********************************n”);paixu_record(flag);break;case 0: printf(“t 謝謝您的使用!n”);break;

      default : break;} } } intmenu_select(){ int i;printf(“

      ********************

      n”);printf(“

      Welcome!

      n

      ”);printf(“

      Form kuangminn”);printf(“

      ********************

      n”);printf(“

      n”);printf(“ n”);printf(“ n”);printf(“

      通訊錄管理系統(tǒng)

      n”);printf(“ n”);printf(“

      ======================n”);printf(“

      1.通訊錄的建立n”);printf(“

      2.通訊者的添加n”);printf(“

      3.通訊錄的查詢n”);printf(“

      4.通訊者的刪除n”);printf(“

      5.通訊錄的存儲n”);printf(“

      6.通訊者的排序n”);printf(“

      0.退出通訊錄管理系統(tǒng)n”);printf(“

      ======================n”);printf(“

      請選擇操作0-5 nn”);for(;;){ scanf(“%d”,&i);if(i<0||i>6)printf(“t對不起,您的輸入錯誤n”);else break;} return i;} intcreate_record(){inti,j;for(i=0;;)

      { printf(“ 學(xué)號(12)姓名(10)出生年月(10)家庭住址(30)郵編(10)電話(15)n”);printf(“-------------n”);scanf(“%s%s%s%s%s%s”,data[i].num,data[i].name,data[i].birthday, data[i].post, data[i].phone);i++;printf(“ 想繼續(xù)創(chuàng)建嗎?(1.是/0.不):”);scanf(“%d”,&j);if(!j)

      return i;else printf(“恭喜你,創(chuàng)建成功!請繼續(xù)創(chuàng)建!n”);

      } return i;} intadd_record(int flag){ int i=flag,j;for(i;;)

      { printf(“ 學(xué)號(12)姓名(10)出生年月(10)家庭住址(30)郵編(10)電話(15)n”);printf(“-------------n”);

      scanf(“%s%s%s%s%s%s”,data[i].num,data[i].name,data[i].birthday,data[i].post, data[i].phone);i++;printf(“ 想繼續(xù)添加嗎?(1.是/0.不):”);scanf(“%d”,&j);if(!j)return i;else printf(“恭喜你,添加成功!請繼續(xù)添加!n”);

      } return(i);} intfind_record(){ int i;char number[6];char named[10];intxz;printf(“--------------------n”);printf(“ 1.按學(xué)號查詢n”);printf(“ 2.按姓名查詢n”);printf(“--------------------n”);printf(“ 請選擇 : n”);

      scanf(“%d”,&xz);if(xz==1){ printf(“ 請輸入要查找的學(xué)號: ”);scanf(“%s”,number);for(i=0;i

      if(strcmp(data[i].num,number)==0)

      { printf(“ ** 學(xué)號姓名出生年月家庭住址郵編電話**n”);printf(“------------------------------n”);printf(“%s,%s,%s,%s,%s,%sn”,data[i].num,data[i].name,data[i].birthday,data[i].post,data[i].phone);printf(“------------------------------n”);return 0;}

      } else if(xz=2){ printf(“請輸入要查找的姓名: ”);scanf(“%s”,named);for(i=0;i

      { printf(“ ** 學(xué)號姓名出生年月家庭住址郵編電話**n”);printf(“------------------------------n”);printf(“%s,%s,%s,%s,%s,%sn”,data[i].num,data[i].name,data[i].birthday,data[i].post,data[i].phone);printf(“------------------------------n”);return 0;else {printf(“對不起,沒有你要找的人!n”);return 0;} }

      else {printf(“對不起,沒有你要找的人!n”);return 0;}

      }

      } intdelete_record(int flag)

      { inti,j;intdeletemark=0;char number[20];printf(“ttt請輸入要刪除學(xué)號:n”);scanf(“%s”,number);for(i=0;i

      { if(strcmp(data[i].num, number)==0)

      { printf(“ttt以下是您要刪除的用戶紀(jì)錄:n”);printf(“ ** 學(xué)號姓名出生年月家庭住址郵編電話**n”);printf(“------------------------------n”);

      printf(“%s,%s,%s,%s,%s,%sn”,data[i].num,data[i].name,data[i].birthday,data[i].post,data[i].phone);printf(“------------------------------n”);

      printf(“ttt是否刪除?(y/n)”);if(getch()=='y' || getch()=='Y')

      { for(j=i;j

      } else return;

      } continue;

      } if(deletemark==0)

      { printf(“ttt沒有該用戶的紀(jì)錄”);

      return;

      } return;

      } voidpaixu_record(int flag){inti,j;struct record tmp;

      printf(“ 1.按姓名排序n”);printf(“ 2.按學(xué)號排序n”);scanf(“%d”,&i);if(i==1){for(i=1;i

      { if(strcmp(data[i].name, data [i-1].name)<0)

      { tmp= data[i];

      j=i-1;do

      { data [j+1]= data [j];j--;}while((strcmp(tmp.name, data [j].name)<0&&j>=0));data [j+1]=tmp;

      }

      } printf(“ttt排序成功!”);}

      if(i==2){for(j=0;jdata[i+1].num)

      {tmp=data[i];data[i]=data[i+1];data[i+1]=tmp;} } }

      intsave_record(int flag){

      FILE*fp;int i;if((fp=fopen(“D:data.txt”,“w+”))==NULL)

      {printf(“無法打開文件!”);exit(0);} for(i=0;i

      {fprintf(fp,“%s,%s,%s,%s,%s,%sn”,data[i].num,data[i].name,data[i].birthday, data[i].post, data[i].phone);printf(“n”);} fclose(fp);return 0;}

      下載C語言實(shí)驗(yàn)電話薄管理系統(tǒng)word格式文檔
      下載C語言實(shí)驗(yàn)電話薄管理系統(tǒng).doc
      將本文檔下載到自己電腦,方便修改和收藏,請勿使用迅雷等下載。
      點(diǎn)此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn)自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進(jìn)行舉報(bào),并提供相關(guān)證據(jù),工作人員會在5個工作日內(nèi)聯(lián)系你,一經(jīng)查實(shí),本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦

        c語言圖書管理系統(tǒng)

        C語言——圖書管理系統(tǒng) 代碼部分: #include #include #include #pragma comment(lib,"libmysql.lib") /*定義數(shù)據(jù)庫相關(guān)操作變量*/ MYSQL mysql; // MYSQL_RES *result......

        c語言銷售管理系統(tǒng)

        課程設(shè)計(jì)說明書 學(xué) 院、系: 專業(yè): 學(xué) 生 姓 名: 設(shè) 計(jì) 題 目: 起 迄 日 期: 指 導(dǎo) 教 師: 學(xué) 號: 銷售管理系統(tǒng) 日期: 2017年5月12日 1 設(shè)計(jì)目的 1.了解管理信息系統(tǒng)的開發(fā)......

        C語言藥房管理系統(tǒng)

        #include #include #include #include struct medicine { char name[20]; //藥品名稱 char number[50]; //藥品編號 char price[50]; //單價(jià) char inventory[50]; //庫存......

        客戶關(guān)系管理系統(tǒng)認(rèn)識實(shí)驗(yàn)

        實(shí)驗(yàn)六、客戶關(guān)系管理系統(tǒng)認(rèn)識實(shí)驗(yàn) 一、實(shí)驗(yàn)?zāi)康? 1.通過對客戶關(guān)系管理教學(xué)模擬系統(tǒng)的使用,對CRM系統(tǒng)的功能和特點(diǎn)有一個初步的認(rèn)識 2.了解CRM系統(tǒng)的數(shù)據(jù)庫結(jié)構(gòu) 3.了解CRM系......

        實(shí)驗(yàn)三 應(yīng)付款管理系統(tǒng)

        廣東海洋大學(xué)寸金學(xué)院學(xué)生實(shí)驗(yàn)報(bào)告書 實(shí)驗(yàn)名稱 系 學(xué)生姓名 實(shí)驗(yàn)三 應(yīng)付款管理系統(tǒng) 課程名稱會計(jì)管理信息系統(tǒng) 班級學(xué)號 專業(yè)實(shí)驗(yàn)地點(diǎn) 實(shí)驗(yàn)樓303 實(shí)驗(yàn)日期 一、 實(shí)驗(yàn)?zāi)康模?1.......

        語言課程設(shè)計(jì)-學(xué)生成績管理系統(tǒng)

        1、 課程設(shè)計(jì)的目的、任務(wù) 《匯編語言》課程設(shè)計(jì)對于鞏固匯編語言理論知識,加強(qiáng)學(xué)生的實(shí)際動手能力和提高學(xué)生綜合素質(zhì)十分必要。課程設(shè)計(jì)的目的主要是通過程序設(shè)計(jì)方法和技......

        C語言食堂飯卡管理系統(tǒng)

        食堂飯卡管理系統(tǒng)3人 基本功能: (1)發(fā)卡:學(xué)生員工持有效證件到管理處繳押金,辦理就餐卡,操作人員將相關(guān)內(nèi)容寫入卡中,并自動產(chǎn)生編號,持卡人員再預(yù)交一定金額款項(xiàng)即可進(jìn)行就餐。 (2......

        C++語言學(xué)生宿舍管理系統(tǒng)(五篇范文)

        #include #include #include using namespace std; typedef struct /*定義結(jié)構(gòu)體數(shù)組*/ { string roomnum; /*房間號*/ string stunum; /*學(xué)號*/ string name; /*姓......