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

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

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

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

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

      C語言課程設計火車票系統(tǒng)源代碼

      時間:2019-05-14 03:36:04下載本文作者:會員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關的《C語言課程設計火車票系統(tǒng)源代碼》,但愿對你工作學習有幫助,當然你在寫寫幫文庫還可以找到更多《C語言課程設計火車票系統(tǒng)源代碼》。

      第一篇:C語言課程設計火車票系統(tǒng)源代碼

      #include #include #include //火車票結構體類型// typedef struct Node {int num;

      //編號// char name[20];

      //起點和終點// char time[5];

      //出發(fā)時間// int price;

      //車票價格// int amount;

      //剩余數量// struct Node *next;}Node;//創(chuàng)建鏈表并輸入數據// struct Node *creat(){ struct Node *head,*r,*s;

      int i=0;

      char choice;

      head=(struct Node *)malloc(sizeof(struct Node));head->next=NULL;r=head;do {

      s=(struct Node *)malloc(sizeof(struct Node));s->next=NULL;printf(“請輸入第%d種火車票的信息:n”,++i);printf(“請輸入火車的編號:”);

      scanf(“%d”,&s->num);

      printf(“起點和終點:”);scanf(“%s”,s->name);printf(“出發(fā)時間:”);scanf(“%s”,s->time);printf(“車票價格:”);scanf(“%d”,&s->price);printf(“剩余數量:”);scanf(“%d”,&s->amount);

      r->next=s;

      r=s;

      printf(“Continue?(Y/N)”);scanf(“%s”,&choice);}while(choice=='Y'||choice=='y');

      r->next=NULL;return(head);} //將單鏈表中的信息保存到文件1.txt中// void save(struct Node *h){

      struct Node *s;FILE *fp;

      char filename[10]=“1.txt”;

      fp=fopen(“1.txt”,“wt”);if(fp==NULL){

      printf(“n寫文件出錯,按任意鍵退出!”);getchar();exit(1);}

      for(s=h->next;s!=NULL;s=s->next)

      fprintf(fp,“%d %s %s %d %d n”,s->num,s->name,s->time,s->price,s->amount);

      getchar();fclose(fp);} // 從文件1.txt中讀取信息并存入單鏈表中// struct Node *read(){ struct Node *head,*r,*s;FILE *fp;char filename[10]=“zl.txt”;fp=fopen(“1.txt”,“rt”);if(fp==NULL){

      printf(“讀文件錯誤,按任意鍵退出!”);getchar();exit(1);} head=(struct Node *)malloc(sizeof(struct Node));head->next=NULL;r=head;while(!feof(fp)){

      s=(struct Node *)malloc(sizeof(struct Node));fscanf(fp,“%d %s %s %d %d”,&s->num,s->name,s->time,&s->price,&s->amount);

      r->next=s;r=s;

      } r->next=NULL;fclose(fp);

      return head;} //將鏈表中的數據輸出// void print(struct Node *h){

      struct Node *s;

      printf(“n火車票信息如下:n”);

      printf(“~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~n”);printf(“編號

      起點和終點

      出發(fā)時間

      車票價格

      剩余票數:n”);

      for(s=h->next;s->next!=NULL;s=s->next){ printf(“ %d

      %10s

      %5s %10d %6dn”,s->num,s->name,s->time,s->price,s->amount);} } //鏈表查詢// struct Node * find(struct Node *h){ int i,j;char s[20];printf(“tt

      查詢方法有以下幾種:n”);printf(“tt

      1.火車票編號n”);printf(“tt

      2.起點和終點n”);printf(“tt

      3.出發(fā)時間n”);printf(“tt

      4.車票價格n”);printf(“tt

      5.剩余票數n”);printf(“請輸入您要查詢的方法的序號:”);scanf(“%d”,&i);switch(i){ case 1:printf(“請輸入你要查詢火車票的編號:”);scanf(“%d”,&j);

      while(h->next!=NULL)

      {

      h=h->next;

      if(h->num==j)return h;

      }

      return NULL;break;case 2:printf(“請輸入您要查詢火車票的起點和終點:”);scanf(“%s”,s);while(h->next!=NULL){

      h=h->next;if(strcmp(h->name,s)==0)

      return h;

      } return NULL;break;case 3:printf(“請輸入您要查詢火車票的時間:”);

      scanf(“%s”,s);

      while(h->next!=NULL)

      {

      h=h->next;

      if(strcmp(h->time,s)==0)

      return h;

      }

      return NULL;

      break;case 4:printf(“請輸入你要查詢火車票的價格 :”);scanf(“%d”,&j);

      while(h->next!=NULL)

      {

      h=h->next;

      if(h->price==j)

      return h;

      }

      return NULL;

      break;case 5:printf(“請輸入你要查詢火車票的剩余票數:”);scanf(“%d”,&j);

      while(h->next!=NULL)

      {

      h=h->next;

      if(h->amount==j)

      return h;

      } return NULL;

      break;} } //修改信息// change(struct Node *h,int k){ int j;struct Node *p;p=find(h);printf(“------------n”);printf(“t

      您要修改哪一項?n”);printf(“t

      1.火車編號n”);printf(“t

      2.起點和終點n”);printf(“t

      3.出發(fā)時間n”);printf(“t

      4.車票價格n”);

      printf(“t

      5.剩余票數n”);printf(“t

      0.退出系統(tǒng)n”);

      printf(“------------n”);printf(“請輸入您要修改項的編號:”);scanf(“%d”,&j);switch(j)

      { case 1:

      printf(“修改后的火車編號:”);

      scanf(“%d”,&p->num);

      break;

      case 2:

      printf(“修改后的起點和終點:”);

      scanf(“%s”,p->name);

      break;

      case 3:

      printf(“修改后的出發(fā)時間:”);

      scanf(“%s”,p->time);

      break;

      case 4:

      printf(“修改后的車票價格:”);

      scanf(“%d”,&p->price);

      break;

      case 5:

      printf(“修改后的剩余票數:”);

      scanf(“%d”,&p->amount);

      break;

      case 0:break;} } //刪除信息// delete(struct Node *h){ struct Node *p;

      int j;

      printf(“請輸入您要刪除的火車票的編號:”);scanf(“%d”,&j);p=h->next;

      if(p==NULL)

      return 0;while(p!=NULL){ if(p->num==j){

      h->next=p->next;

      free(p);

      return 1;} h=p;p=p->next;

      } return 0;} //添加信息// void append(){

      struct Node *p;

      FILE *fp;

      fp=fopen(“1.txt”,“at+”);

      if(fp==NULL)

      {

      printf(“寫文件出錯,按任意鍵返回.n”);getchar();exit(1);

      }

      printf(“請輸入要添加的火車票的信息:火車編號,起點和終點,出發(fā)時間,車票價格,剩余票數:n”);scanf(“%d%s%s%d%d”,&p->num,p->name,p->time,&p->price,&p->amount);fprintf(fp,“%d %s %s %d %dn”,p->num,p->name,p->time,p->price,p->amount);getchar();fclose(fp);} //數據的統(tǒng)計// void count(struct Node *h){ struct Node *s;s=h;int i,j,k,n=0;printf(“*****************************************************************************n”);

      printf(“tt

      請選擇您要統(tǒng)計項目的序號:n”);

      printf(“tt

      1.車票價格n”);

      printf(“tt

      2.剩余票數n”);printf(“tt

      0.退出界面n”);

      scanf(“%d”,&i);switch(i)

      {

      case 1:

      printf(“請輸入您要統(tǒng)計車票的價格的標準:”);

      scanf(“%d”,&j);

      printf(“tt

      請選擇低于或高于標準:n”);

      printf(“tt

      1.價格低于%d的個數n”,j);

      printf(“tt

      2.價格高于%d的個數n”,j);

      scanf(“%d”,&k);

      if(k==1)

      {

      for(s=h->next;s->next!=NULL;s=s->next)

      if(s->price

      n++;

      printf(“車票價格低于%d的個數有%d個.n”,j,n);

      }

      else

      {

      for(s=h->next;s->next!=NULL;s=s->next)

      if(s->price>j)

      n++;

      printf(“車票價格低于%d的個數有%d個.n”,j,n);

      }

      break;

      case 2:

      printf(“請輸入您要統(tǒng)計剩余票數的數量:”);

      scanf(“%d”,&j);

      printf(“tt

      請選擇低于或高于所輸票數:n”);

      printf(“tt

      1.票數低于%d的個數n”,j);

      printf(“tt

      2.票數高于%d的個數n”,j);

      scanf(“%d”,&k);

      if(k==1)

      {

      for(s=h->next;s->next!=NULL;s=s->next)

      if(s->amount

      n++;

      printf(“剩余票數低于%d的個數有%d個.n”,j,n);

      }

      else

      {

      for(s=h->next;s->next!=NULL;s=s->next)

      if(s->amount>j)

      n++;

      printf(“剩余票數高于%d的個數有%d個.n”,j,n);

      }

      break;

      case 0:break;

      } } //保存用戶和密碼到文件2.txt中// void save_user(){

      char file[10]=“2.txt”;FILE *fp;char name[20];char pwd[10];fp=fopen(“2.txt”,“at+”);if(fp==NULL){ printf(“n寫文件出錯,按任意鍵退出.n”);

      getchar();exit(1);} printf(“請輸入用戶名:”);

      scanf(“%s”,name);printf(“請輸入密碼:”);

      scanf(“%s”,pwd);

      fprintf(fp,“%s %sn”,name,pwd);

      getchar();

      fclose(fp);

      printf(“用戶注冊成功!n”);} //檢驗用戶和密碼是否匹配// int check(char *name,char *pwd){ char name1[20];char pwd1[10];FILE *fp;char file[10]=“2.txt”;if((fp=fopen(“2.txt”,“rt”))==NULL){

      printf(“讀文件出錯,按任意鍵退出!n”);

      getchar();

      exit(1);}

      while(!feof(fp)){

      fscanf(fp,“%s %s”,name1,pwd1);

      if(strcmp(name1,name)==0&&strcmp(pwd1,pwd)==0)

      return 1;} return 0;} //數據排序// void sort(struct Node *h){ struct Node *s,*p,*m,*n;int t,t1,t2,t3;char s1[20];char s2[10];

      printf(“車票價格由小到大排序如下:n”);for(s=h->next;s->next!=NULL;s=s->next)for(p=s->next;p->next!=NULL;p=p->next)

      if(s->price>p->price)

      {

      t1=s->num;s->num=p->num;p->num=t1;

      t2=s->price;s->price=p->price;p->price=t2;

      t3=s->amount;s->amount=p->amount;p->amount=t3;

      strcpy(s1,s->name);strcpy(s->name,p->name);strcpy(p->name,s1);

      strcpy(s2,s->time);strcpy(s->time,p->time);strcpy(p->time,s2);

      }

      print(h);printf(“nn剩余車票數量由多到少排序如下:n”);for(s=h->next;s->next!=NULL;s=s->next)

      for(p=s->next;p->next!=NULL;p=p->next)

      if(s->amount

      amount)

      {

      t1=s->num;s->num=p->num;p->num=t1;

      t2=s->price;s->price=p->price;p->price=t2;

      t3=s->amount;s->amount=p->amount;p->amount=t3;

      strcpy(s1,s->name);strcpy(s->name,p->name);strcpy(p->name,s1);

      strcpy(s2,s->time);strcpy(s->time,p->time);strcpy(p->time,s2);

      } print(h);} void main(){ struct Node *head,*p;int i,j,k;head=(struct Node *)malloc(sizeof(struct Node));head->next=NULL;char name[20];char pwd[10];printf(“n***************歡迎進入火車票管理系統(tǒng)******************n”);printf(“tt 1.用戶登錄n”);printf(“tt 2.用戶注冊n”);printf(“tt 0.退出系統(tǒng) n”);printf(“請輸入所選序號:”);scanf(“%d”,&k);

      switch(k){ case 1: printf(“請輸入用戶名:”);

      scanf(“%s”,name);

      printf(“請輸入密碼:”);

      scanf(“%s”,pwd);

      if(check(name,pwd))

      {

      printf(“密碼正確.n”);

      do

      {

      printf(“nntt*********************歡迎進入火車票管理系統(tǒng)***********************n”);

      printf(“tt

      1.錄入火車票信息tt

      2.添加火車票信息n”);

      printf(“tt

      3.修改火車票信息tt

      4.刪除火車票信息n”);

      printf(“tt

      5.打印火車票信息tt

      6.查詢火車票信息n”);

      printf(“tt

      7.統(tǒng)計火車票信息tt

      8.火車票銷售排行n”);

      printf(“tt

      0.退出系統(tǒng)n”);

      printf(“請輸入您要進入菜單的序號(0-8):”);

      scanf(“%d”,&i);

      switch(i)

      {

      case 1:

      printf(“請錄入火車票信息nn”);

      head=creat();

      save(head);

      head=read();

      break;

      case 2:

      append();

      break;

      case 3:

      printf(“請輸入您要修改的火車票的編號:”);

      scanf(“%d”,&j);

      change(head,j);

      save(head);

      break;

      case 4:

      head=read();

      if(delete(head))

      {

      printf(“已正確刪除!n”);

      save(head);

      }

      else

      printf(“要刪除的結點不存在!n”);

      break;

      case 5:

      head=read();

      print(head);

      break;

      case 6:

      printf(“請輸入您要查詢火車票的編號(以0結束):”);

      scanf(“%d”,&j);

      {

      p=find(head);

      printf(“編號

      起點和終點

      出發(fā)時間

      車票價格

      剩余票數:n”);

      printf(“%d

      %10s

      %5s %10d %6dn”,p->num,p->name,p->time,p->price,p->amount);

      printf(“請繼續(xù)輸入序號(以0結束):”);

      scanf(“%d”,&j);

      }

      break;

      case 7: head=read();count(head);break;

      case 8: sort(head);break;

      case 0: printf(“************************用!*****************************n”);break;

      }

      }while(i!=0);

      }

      else

      printf(“密碼錯誤或用戶名不存在.n”);

      break;case 2:save_user();break;case 0:break;}

      使

      第二篇:C語言課程設計——飛機訂票系統(tǒng)源代碼

      #include //標準輸入、輸出頭文件 #include //包含字符串函數處理頭文件 #include

      //包含access函數的頭文件 #define N 9999

      //定義最多的航班數

      #define PRINT “%dtt%stt%stt星期%stt%dn ”,s[i].num,s[i].start,s[i].over,s[i].time,s[i].count

      //宏定義輸出格式

      struct air

      //定義結構體數組 { int num;

      //定義航班號

      char start[20];//航班起始站

      char over[20];//終點站

      char time[10];//飛行時間

      int count;

      //機票數量 }s[N];

      int i,m=0;

      //定義全局變量 char ii[10];

      void add();//函數聲明增加航班信息函數 void print();

      //顯示航班信息 void search();//查找航班信息 void dingpiao();//訂票業(yè)務 void tuipiao();//退票 void read();//讀取文件

      void save();//保存文件 void output();//輸出格式 void paixu();//航班排序 void chushihua();//系統(tǒng)初始化 void build();//建立數據文件 void paixu1();//按航班號從小到大排序 void paixu2();//從大到小

      void main()//主函數 { int j;

      chushihua();//系統(tǒng)初始化判斷是否存在原始數據文件

      printf(“

      歡迎使用飛機訂票系統(tǒng)n”);//打印出系統(tǒng)主界面

      do {

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

      printf(“1.增加航班信息n”

      “t2.瀏覽航班信息n”

      “tt3.查找航班信息(按航班號)tt╮(╯_╰)╭n”

      “ttt4.航班排序(按航班號)n”

      “tttt5.訂票業(yè)務n”

      “to(︶︿︶)ottt6.退票業(yè)務n”

      “tttttt0.退出n”);printf(“================================== ”);

      printf(“請在0-6中選擇以回車鍵結束: ”);scanf(“%d”,&j);switch(j){

      case 1: add();//調用增加航班函數

      break;

      case 2:print();//調用顯示模塊

      break;

      case 3:search();//調用查找模塊

      break;

      case 4:paixu();//調用排序函數

      break;

      case 5:dingpiao();//調用訂票模塊

      break;

      case 6:tuipiao();//調用退票模塊

      break;

      case 0:

      //退出系統(tǒng)

      save();

      printf(“謝謝使用,再見!”);

      break;} }while(j!=0);//判斷是否調用其他函數

      }

      void chushihua()//定義系統(tǒng)初始化函數 { if(access(“hangban.dat”,0)){

      build();} else

      read();} void build()//定義建立數據文件函數 { FILE *fp;//定義文件指針

      if((fp=fopen(“hangban.dat”,“wb”))==NULL)//打開文件并判定是否出錯

      {

      printf(“創(chuàng)建文件失敗!”);//打印出錯提示

      getchar();

      return;} printf(“請依次輸入航班信息(以回車鍵結束):n”);

      //打印提示信息

      printf(“------------n”);for(i=0;i

      printf(“請輸入航班號: ”);

      scanf(“%d”,&s[i].num);//輸入航班號

      printf(“請輸入起始站: ”);

      scanf(“%s”,s[i].start);//輸入起始站

      printf(“請輸入終點站: ”);

      scanf(“%s”,s[i].over);//輸入終點站

      printf(“請輸入時間(星期幾): ”);

      scanf(“%s”,s[i].time);//輸入時間

      printf(“請輸入機票數: ”);

      scanf(“%d”,&s[i].count);//輸入機票數

      fwrite(&s[i],sizeof(struct air),1,fp);

      m++;

      printf(“添加完畢,是否繼續(xù)添加?請鍵入y或n以回車鍵結束:”);

      scanf(“%s”,ii);

      if(strcmp(ii,“y”)!=0)

      //判斷是否繼續(xù)添加航班信息

      {

      fclose(fp);

      //關閉文件

      return;

      } } }

      void read()

      //定義讀取文件函數 { FILE *fp;if((fp=fopen(“hangban.dat”,“r”))==NULL){

      printf(“創(chuàng)建文件失敗!”);

      getchar();

      return;} i=0;while(!feof(fp)){

      fread(&s[i],sizeof(struct air),1,fp);//逐塊讀取數據

      i++;

      m++;//計算存在航班數

      } m--;fclose(fp);}

      void save()//定義保存函數 { FILE *fp;if((fp=fopen(“hangban.dat”,“wb”))==NULL)

      {

      printf(“創(chuàng)建文件失敗!”);

      getchar();

      return;} for(i=0;i

      //逐塊保存數據

      fwrite(&s[i],sizeof(struct air),1,fp);fclose(fp);}

      void add()//定義增加航班信息函數 { do{

      printf(“請依次輸入您要增加的航班信息(以回車鍵結束): n”);

      //打印提示信息

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

      printf(“請輸入航班號: ”);

      scanf(“%d”,&s[m].num);//讀取航班號

      printf(“請輸入起始站: ”);

      scanf(“%s”,s[m].start);//讀取起始站

      printf(“請輸入終點站: ”);

      scanf(“%s”,s[m].over);//讀取終點站

      printf(“請輸入時間: ”);

      scanf(“%s”,s[m].time);//讀取時間

      printf(“請輸入機票數: ”);

      scanf(“%d”,&s[m].count);//讀取機票數

      m++;

      printf(“添加完畢,是否繼續(xù)添加?請鍵入y或n以回車鍵結束:”);

      scanf(“%s”,ii);}while(!strcmp(ii,“y”));//判斷是否繼續(xù)添加 }

      void output()//定義輸出格式函數 { printf(“航班號tt起始站tt終點站tt時間tt機票數n”);//信息標題

      for(i=0;i

      printf(PRINT);//打印出信息

      }

      void print()//定義顯示航班信息函數 { printf(“n目前我們有如下航班:n”);output();

      //調用輸出格式函數

      printf(“n請按回車鍵返回上層菜單 ”);getchar();getchar();}

      void search()//定義查詢函數 { int n;

      do {

      printf(“n請輸入航班號: ”);

      scanf(“%d”,&n);//輸入查詢的航班號

      for(i=0;i

      {

      if(s[i].num==n)//按航班號判定輸出條件

      {

      printf(“n您所查找的航班信息為:n ”);

      printf(“航班號tt起始站tt終點站tt時間tt機票數 nn”);

      printf(PRINT);//顯示信息

      printf(“n查詢完畢,按回車鍵繼續(xù)”);

      getchar();

      getchar();

      return;

      } } printf(“n對不起,沒有您需要的信息!n ”);printf(“是否重新查找?請鍵入y或n以回車鍵結束 ”);scanf(“%s”,ii);}while(!strcmp(ii,“y”));//判定是否重新查找 }

      void dingpiao()//定義訂票業(yè)務函數 { int n;char a[10]=“y”;do {

      search();//調用查詢模塊

      if(!strcmp(ii,“n”))

      {

      printf(“對不起!沒有找到您所需要的航班,所以不能訂票。n”);//未查找到所需航班

      printf(“n請按回車鍵返回上層菜單 ”);

      getchar();

      getchar();

      strcpy(ii,“n”);

      break;

      }

      do

      {

      printf(“請輸入您要訂的機票數(以回車鍵結束): ”);

      scanf(“%d”,&n);//輸入所訂機票數

      if(n<=0)

      //判定機票數是否出錯

      {

      printf(“輸入錯誤!至少需訂1張機票。n”);

      }

      else if(s[i].count==0)//判定機票是否售完

      {

      printf(“對不起,你所選擇的航班的機票已售完!n”);

      break;

      }

      else if(s[i].count!=0&&s[i].count>=n)//判定機票數是否大于等于訂票數

      {

      s[i].count=s[i].count-n;

      printf(“訂票成功!”);

      break;

      }

      else if(s[i].count

      {

      printf(“對不起,你所選擇的航班只剩 %d張機票n”, s[i].count);

      printf(“是否需要重新輸入機票數?請輸入y或n以回車鍵結束: ”);//判定是否重新輸入訂票數

      scanf(“%s”,a);

      }

      }while(!strcmp(a,“y”));

      printf(“是否需要訂其他航班的機票?請輸入y或n以回車鍵結束: ”);

      scanf(“%s”,a);}while(!strcmp(a,“y”));//判定是否繼續(xù)訂票 }

      void tuipiao()//定義退票函數 { int n;char a[10];do {

      search();//調用查詢函數

      if(!strcmp(ii,“n”))

      {

      printf(“對不起!沒有找到您所需要的航班,所以不能退票。n”);

      printf(“n請按回車鍵返回上層菜單 ”);

      getchar();

      getchar();

      strcpy(ii,“n”);

      break;

      }

      printf(“請輸入您要退的機票數目: ”);

      scanf(“%d”,&n);//輸入所退票數

      if(n<=0)

      //判定票數是否有效

      printf(“輸入錯誤!至少需退1張機票。”);

      else

      {

      s[i].count=s[i].count+n;

      printf(“退票成功!”);

      }

      printf(“是否繼續(xù)? 請鍵入y或n以回車鍵結束: ”);//判定是否繼續(xù)退票

      scanf(“%s”,a);}while(!strcmp(a,“y”));//判定并跳出循環(huán)

      }

      void paixu()//定義排序函數 { int n;

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

      printf(“1.按航班號從小到大排序n”

      “t2.按航班號從大到小排序n”);printf(“******************************************************************************** ”);

      printf(“請在1-2中選擇以回車鍵結束: ”);scanf(“%d”,&n);//輸入排序方式

      switch(n){

      case 1:paixu1();//調用從小到大排序函數

      break;

      case 2:paixu2();//調用從大到小排序函數

      break;} printf(“排序后的航班信息為:n”);output();

      //顯示排序后航班信息

      printf(“n請按回車鍵返回上層菜單 ”);

      getchar();

      getchar();}

      void paixu1()//定義從小到大排序函數 { int k,j;struct air t;for(i=0;i

      {

      k=i;

      for(j=i+1;j

      if(s[k].num>s[j].num)

      k=j;

      if(i!=k)

      {

      t=s[k];

      s[k]=s[i];

      s[i]=t;

      } } }

      void paixu2()//定義從大到小排序函數 {

      } int k,j;struct air t;for(i=0;i

      if(s[k].num

      k=j;if(i!=k){

      t=s[k];

      s[k]=s[i];

      s[i]=t;} }

      第三篇:c語言課程設計-學籍管理系統(tǒng)(含源代碼)

      課 程 設 計 課程設計名稱: C語言程序設計 題 目:學籍管理系統(tǒng) 學 生 姓 名: 學生學號 : 學 院(系): 軟件學院 專 業(yè) 班 級: 112021 指 導 教 師:

      設計時間: 2012 年 9 月 日 ? 2012 年 9月_ 14 日

      實驗題目:學籍管理系統(tǒng)一、實驗目的

      綜合應用所學的C語言程序設計知識,自行設計并實現一個較為完整的小型管理信息系統(tǒng)。通過系統(tǒng)分析、系統(tǒng)設計、編程實現,寫實驗報告等環(huán)節(jié),初步掌握軟件系統(tǒng)的設計方法和步驟,提高靈活運用程序語言進行軟件開發(fā)的技能,提高程序設計水平和分析問題、解決問題的能力。

      二、實驗內容

      1):熟悉C語言的開發(fā)環(huán)境,按照給定的上機步驟練習完成;

      2):熟悉C程序的編輯,編譯,鏈接和運行的過程。3):編譯一個應用系統(tǒng)程序,形成一個軟件系統(tǒng)。

      三.實驗要求

      1.1、分析系統(tǒng)功能

      (1)用戶進入主菜單后,就會在看到,菜單選項中添加有系統(tǒng)的各項功能,進入的

      應的選項就可進行相應的操作.其主要功能有:

      1、錄入學生信息

      2、刪除學生信息

      3、查詢學生信息

      4、學生信息排序

      5、改學生信息

      6、保存退出系統(tǒng)

      (2)用戶選擇所需操作的選項,進入相應的操作界面,在這里用戶就可開始進行操作。

      四、使用說明

      學生學籍管理系統(tǒng)是針對學生信息的管理,主要功能是添加學生信息、刪除學生信息、查詢學生信息、學生信息排序、修改學生信息、保存信息。

      1,用戶打開程序,進入主界面,輸入學生信息如圖

      2,按回車進入主菜單,列出各項功能如圖

      輸入1,是查詢整個班級的學生的信息,如圖

      輸入2,是查詢個別學生的信息,如查詢第一學生的信息,如圖

      輸入3,是刪除個別學生的信息,如刪除第一個學生,如圖

      輸入4,是插入某些學生的信息,如插入第三個,如圖

      輸入5,是修改某個同學的信息,如刪除第一個,如圖

      三、心得體會

      兩周的課程過起來其實也是很快的。這是我第一次做課程設計,起初還沒做的時候覺得很快自己就將得編一個較大的程序,將會很有意思。帶著最初的好奇心,新鮮感就這樣開始了第一天的編程,結果是大失所望。做課程設計并不是自己想象中的那樣有意思,而是很枯燥,很乏味的。也沒想象中的那樣簡單,并不是像我們平時上C語言課時,每次編的那些小程序,沒那么簡單。我們現在要做的就是將我們平時學的,做的那些小程序都合理的湊到一塊兒來。而把這些小程序都加到一塊兒來,并不是隨意的將它們放到一個程序中就完事的,而是必須得合理,且得顧及到各個方面。

      正是由于編程的紛繁復雜,且結構的嚴謹,因此編程的過程中到處是困難和問題。它考驗的不僅是我們的平時用功程度,以及我們對所學知識的熟練掌握程度、應用的靈活程度,它還考驗我們的毅力。在剛開始的幾天時,由于前一陣忙于各科的考試,C語言已經好久沒碰了,所學的知識都有點遺忘了,在編寫時處處碰壁,一直會停頓翻書,編得自己都開始心煩意亂了,實在是編不下去了,于是索性就停了三天去看書,先把書給吃透。并在后期的程序調試中也碰到不少的問題,好多問題自己反復檢查了幾遍都沒查出,但在老師的幫助下還是一下就查出了。并不是這些問題多難,而是不夠心細。因此做課程設計、編程時,它還考驗并鍛煉我們的心細程度。

      經過這次的課程設計的實踐,我受益頗多,不僅是對我掌握知識、靈活運用知識的一次考驗和鍛煉,也是對我生活態(tài)度的一次鍛煉,讓我學會心細和擁有毅力,更具信心和恒心,碰到困難不再退縮,而是堅強面對。

      四,程序編碼

      /*做一個學生的學籍管理系統(tǒng),有輸入,查詢,刪除,增加,修改等功能*/ #include /*程序需要的頭文件*/ #include

      #include #include #include #define SIZE 4

      /*聲明數組的大小,可以任意改動*/ int board[50][50];/*聲明一個表格的數組*/ int cur_x, cur_y;/*定義坐標*/

      void init();/*聲明一個初始化界面的函數*/ void clear();/*清除界面的函數*/

      void draw_board();/*聲明一個函數畫表格*/ struct student{/*創(chuàng)建一個學生的結構體*/

      char stuNo[8];

      /*學生的學號*/

      char name[10];/*學生的姓名*/

      char sex[2];/*學生的性別*/

      char score[4];

      /*學生的分數*/

      char address[10];/*學生的地址*/ };void init()/*初始化函數*/ {

      int gdriver, gmode, i, j;

      gdriver = DETECT;/*圖形界面的驅動聲明*/

      registerbgidriver(EGAVGA_driver);

      initgraph(&gdriver, &gmode, “");

      for(i = 0;i < 10;i ++)

      for(j = 0;j < 10;j++)/*聲明坐標的間距*/

      board[i][j] = 0;

      cur_x = 1;

      cur_y = 1;}

      void destroy()/*關閉圖形驅動器*/ {

      closegraph();}

      void draw_board(int n)/*畫表格的函數*/ {

      int i, j;

      for(i = 20;i <=5*160+80;i += 90)/*劃橫線的循環(huán)*/

      {

      line(i, 20, i,(n+1)*60+20);

      }

      for(i = 20;i <=(n+1)*60+30;i += 60)/*劃縱線的循環(huán)*/

      {

      line(20, i, 5*110+10, i);

      } }

      void main(){

      struct student stu[SIZE],stu_temp;/*聲明結構體變量*/

      FILE *fp;

      /*聲明文件型的指針*/

      int i,j,n,m,h;

      int c=1;/*c為循環(huán)次數*/

      h=0;

      fp=fopen(”c:list.txt“,”wb+“);/*打開寫入文件*/

      init();/*調用函數*/

      draw_board(SIZE);

      if(fp==NULL)/*驗證文件是否為空*/

      {

      printf(”cannot open this filen“);

      exit(0);

      }

      printf(”input all %d students's data.n“,SIZE);/*畫輸入學生信息的表*/

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      for(i=0;i

      {

      gotoxy(7,4*(i+2));

      printf(”%d“,i);

      gotoxy(17,4*(i+2));

      scanf(”%s“,&stu[i].stuNo);

      gotoxy(29,4*(i+2));

      scanf(”%s“,&stu[i].name);

      gotoxy(41,4*(i+2));

      scanf(”%s“,&stu[i].sex);

      gotoxy(52,4*(i+2));

      scanf(”%s“,&stu[i].score);

      gotoxy(63,4*(i+2));

      scanf(”%s“,&stu[i].address);

      }

      for(i=0;i

      if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1)

      {

      printf(”file write error!“);

      exit(0);

      }

      rewind(fp);

      clrscr();

      for(c=1;c<100;c++)/*創(chuàng)建一個圖形界面*/

      {

      textbackground(0);

      textcolor(1);

      gotoxy(29,7);

      printf(”read->1“);

      gotoxy(29,9);

      printf(”find->2“);

      gotoxy(29,11);

      printf(”delete->3“);

      gotoxy(29,13);

      printf(”insert->4“);

      gotoxy(29,15);

      printf(”modify->5“);

      gotoxy(29,17);

      printf(”plese enter j= “);

      scanf(”%d“,&j);

      clrscr();

      if(j==1)/*當輸入為1時,顯示整個班級

      {的學生信息*/

      draw_board(SIZE);

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      for(i=0;i

      {

      fread(&stu_temp,sizeof(struct student),1,fp);出每個學生的信息*/

      gotoxy(7,4*(i+2));

      printf(”%d“,i);

      gotoxy(17,4*(i+2));

      printf(”%s“,stu[i].stuNo);

      gotoxy(29,4*(i+2));

      printf(”%s“,stu[i].name);

      gotoxy(41,4*(i+2));

      printf(”%s“,stu[i].sex);

      gotoxy(52,4*(i+2));

      printf(”%s“,stu[i].score);

      gotoxy(63,4*(i+2));

      printf(”%s“,stu[i].address);

      }

      fclose(fp);

      /*關閉文件*/

      getch();/*留在當前界面*/

      clrscr();/*清屏*/

      }

      if(j==2)/*當輸入為2時,查找某個學生的 {信息*/

      rewind(fp);/*移動指針到最前*/

      printf(”look up the nth(n<4)student,plese enter n= :n“);/*輸入要查找的學生

      scanf(”%d“,&i);位置*/

      clrscr();

      draw_board(1);/*畫表格*/

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      fseek(fp,(i-1)*sizeof(struct student),0);/*打開文件查找,讀出信

      fread(&stu_temp,sizeof(struct student),1,fp);息*/

      gotoxy(7,8);

      printf(”%d“,i);

      gotoxy(17,8);

      printf(”%s“,stu[i].stuNo);

      gotoxy(29,8);

      printf(”%s“,stu[i].name);

      gotoxy(41,8);

      printf(”%s“,stu[i].sex);

      gotoxy(52,8);

      printf(”%s“,stu[i].score);

      gotoxy(63,8);

      printf(”%s“,stu[i].address);

      }

      fclose(fp);

      getch();

      clrscr();

      if(j==3)/*當輸入為3,刪除某個學生的信息*/

      {

      h=h-1;/*表格少畫一格*/

      printf(”you want delete nth student,plese enter n= “);

      scanf(”%d“,&n);

      draw_board(SIZE+h);/*調用函數畫表格*/

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      for(m=n;m

      {

      strcpy(stu[m].stuNo,stu[m+1].stuNo);

      strcpy(stu[m].name,stu[m+1].name);

      strcpy(stu[m].sex,stu[m+1].sex);

      strcpy(stu[m].score,stu[m+1].score);

      strcpy(stu[m].address,stu[m+1].address);

      }

      for(i=0;i

      {

      fread(&stu_temp,sizeof(struct student),1,fp);個表格*/

      gotoxy(7,4*(i+2));

      printf(”%d“,i);

      gotoxy(17,4*(i+2));

      printf(”%s“,stu[i].stuNo);

      gotoxy(29,4*(i+2));

      printf(”%s“,stu[i].name);

      gotoxy(41,4*(i+2));

      printf(”%s“,stu[i].sex);

      gotoxy(52,4*(i+2));

      printf(”%s“,stu[i].score);

      gotoxy(63,4*(i+2));

      printf(”%s“,stu[i].address);

      }

      fclose(fp);

      getch();

      clrscr();

      } if(j==4)/*當輸入為4時,增加一個學生

      {信息*/

      h=h+1;

      printf(”you want insert nth student,plese enter n= “);

      scanf(”%d“,&n);

      for(m=n;m

      {息*/

      strcpy(stu[m+1].stuNo,stu[m].stuNo);

      strcpy(stu[m+1].name,stu[m].name);

      strcpy(stu[m+1].sex,stu[m].sex);

      strcpy(stu[m+1].score,stu[m].score);

      strcpy(stu[m+1].address,stu[m].address);

      }

      draw_board(1);/*調用函數畫表格*/

      gotoxy(7,4*2);

      printf(”%d“,n);

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      gotoxy(17,8);/*輸入一個新學生的 scanf(”%s“,&stu[n].stuNo);信息*/

      gotoxy(29,8);

      scanf(”%s“,&stu[n].name);

      gotoxy(41,8);

      scanf(”%s“,&stu[n].sex);

      gotoxy(52,8);

      scanf(”%s“,&stu[n].score);

      gotoxy(63,8);

      scanf(”%s“,&stu[n].address);

      gotoxy(7,8);

      printf(”%d“,i);

      gotoxy(17,8);

      printf(”%s“,stu[n].stuNo);

      gotoxy(29,8);

      printf(”%s“,stu[n].name);

      gotoxy(41,8);

      printf(”%s“,stu[n].sex);

      gotoxy(52,8);

      printf(”%s“,stu[n].score);

      gotoxy(63,8);

      printf(”%s“,stu[n].address);

      clrscr();

      draw_board(SIZE+h);

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      for(i=0;i

      {

      fread(&stu_temp,sizeof(struct student),1,fp);表格*/

      gotoxy(7,4*(i+2));

      printf(”%d“,i);

      gotoxy(17,4*(i+2));

      printf(”%s“,stu[i].stuNo);

      gotoxy(29,4*(i+2));

      printf(”%s“,stu[i].name);

      gotoxy(41,4*(i+2));

      printf(”%s“,stu[i].sex);

      gotoxy(52,4*(i+2));

      printf(”%s“,stu[i].score);

      gotoxy(63,4*(i+2));

      printf(”%s“,stu[i].address);

      }

      fclose(fp);

      getch();

      clrscr();

      }

      if(j==5)/*當輸入為5,修改某個學生

      {信息*/

      printf(”you want to modify nth student information,plese enter n= “);

      scanf(”%d“,&n);

      /*輸入修改的學生的位置*/

      draw_board(1);

      draw_board(1);

      gotoxy(7,4*2);

      printf(”%d“,n);

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      gotoxy(17,8);

      /*輸入新的學生信息*/

      scanf(”%s“,&stu[n].stuNo);

      gotoxy(29,8);

      scanf(”%s“,&stu[n].name);

      gotoxy(41,8);

      scanf(”%s“,&stu[n].sex);

      gotoxy(52,8);

      scanf(”%s“,&stu[n].score);

      gotoxy(63,8);

      scanf(”%s“,&stu[n].address);

      gotoxy(7,8);

      clrscr();

      draw_board(SIZE);

      gotoxy(17,4);

      printf(”stuNo“);

      gotoxy(29,4);

      printf(”name“);

      gotoxy(41,4);

      printf(”sex“);

      gotoxy(52,4);

      printf(”score“);

      gotoxy(63,4);

      printf(”address“);

      for(i=0;i

      {

      fread(&stu_temp,sizeof(struct student),1,fp);

      gotoxy(7,4*(i+2));

      printf(”%d“,i);

      gotoxy(17,4*(i+2));

      printf(”%s“,stu[i].stuNo);

      gotoxy(29,4*(i+2));

      printf(”%s“,stu[i].name);

      gotoxy(41,4*(i+2));

      printf(”%s“,stu[i].sex);

      gotoxy(52,4*(i+2));

      printf(”%s“,stu[i].score);

      gotoxy(63,4*(i+2));

      printf(”%s",stu[i].address);

      }

      fclose(fp);/*關閉文件*/

      getch();/*保留在這個界面上*/

      clrscr();/*清屏*/

      }

      }

      }

      第四篇:圖書管理系統(tǒng)(含源代碼)c語言_數據結構課程設計報告

      數據結構大作業(yè) 121279044 伍楊

      數據結構大作業(yè) 圖書管理系統(tǒng)

      工程管理 121279044 伍楊

      目錄一、二、三、題目要求...................................................................2 總體設計...................................................................2 編碼實現...................................................................3 1)定義圖書結構體.......................................................3 2)登記操作...............................................................4 3)查看操作...............................................................8 4)刪除操作.............................................................11 5)Main函數...........................................................20四、五、六、調試與測試..............................................................26 五心得體會..............................................................28 用戶手冊.................................................................28

      數據結構大作業(yè) 121279044 伍楊

      一、題目要求

      1)目的要求

      本課程設計任務的目的是要求學生按照分析、設計、編碼、調試和測試的軟件開發(fā)過程獨立完成管理系統(tǒng)設計,以及C語言算法的掌握,并能最終實現本系統(tǒng)的功能要求,通過這個程序可以學習到以前調試短程序沒有的的經驗。2)題目要求

      實現圖書管理信息系統(tǒng)的設計。要求實現圖書添加、顯示全部圖書、查詢、借閱和歸還。主要考查利用文件的操作!

      二、總體設計

      數據結構大作業(yè) 121279044 伍楊

      三、編碼實現

      1)定義圖書結構體

      struct book{

      char bookname[20];

      //書名

      int NO;

      //書編號

      char type[20];

      //類型

      int date;

      //到書日期 };struct person{

      char name[10];

      //姓名

      char classes[20];

      //班級

      int number;

      //學號

      char telephone[12];

      //聯系電話

      int NO;

      //書編號

      char bookname[20];

      //書名

      int borrowdate;

      //借書日期

      int returndate;

      //還書日期

      數據結構大作業(yè) 121279044 伍楊

      2)登記操作

      void new_book(){ FILE *fp;struct book b;//登記新書

      int i,j;

      printf(“請朱老師輸入此次收到的書本總數:”);if((fp=fopen(“shuku.txt”,“a”))==NULL){ printf(“File open error!n”);exit(0);}

      scanf(“%d”,&i);

      for(j=0;j

      printf(“請朱老師輸入書名:”);scanf(“%s”,b.bookname);fprintf(fp,“%s”,b.bookname);printf(“請朱老師輸入書編號:”);scanf(“%d”,&b.NO);fprintf(fp,“

      %d”,b.NO);printf(“請朱老師輸入類型:”);scanf(“%s”,b.type);

      數據結構大作業(yè) 121279044 伍楊

      }

      } fprintf(fp,“

      %s”,b.type);printf(“請朱老師輸入到書日期:”);scanf(“%d”,&b.date);fprintf(fp,“

      %d”,b.date);if(fclose(fp)){

      } printf(“Can not close the file!n”);exit(0);void new_person()

      {

      FILE *fp;struct person p;char choice;

      //登記借書

      if((fp=fopen(“jieshujilu.txt”,“a”))==NULL){ printf(“File open error!n”);exit(0);}

      數據結構大作業(yè) 121279044 伍楊

      printf(“請朱老師輸入借書人姓名:”);scanf(“%s”,p.name);fprintf(fp,“%s”,p.name);printf(“請朱老師輸入借書人班級:”);scanf(“%s”,p.classes);fprintf(fp,“

      %s”,p.classes);printf(“請朱老師輸入借書人學號:”);scanf(“%d”,&p.number);fprintf(fp,“

      %d”,p.number);printf(“請朱老師輸入借書人聯系電話:”);scanf(“%s”,p.telephone);fprintf(fp,“

      %s”,p.telephone);printf(“請朱老師輸入書編號:”);scanf(“%d”,&p.NO);fprintf(fp,“

      %d”,p.NO);printf(“請朱老師輸入書名:”);scanf(“%s”,p.bookname);fprintf(fp,“

      %s”,p.bookname);printf(“請朱老師輸入借書日期:”);scanf(“%d”,&p.borrowdate);fprintf(fp,“

      %d”,p.borrowdate);

      數據結構大作業(yè) 121279044 伍楊

      printf(“請朱老師輸入還書日期:”);scanf(“%d”,&p.returndate);fprintf(fp,“

      %d”,p.returndate);printf(“nt您想繼續(xù)嗎?(y/n)”);scanf(“ %c”,&choice);if(choice=='Y'||choice=='y'){

      } system(“cls”);new_person();if(fclose(fp)){

      } printf(“Can not close the file!n”);exit(0);}實現程序對文件的讀取 void Read(){

      int i=0;int j=0;ifstream in(“Libra.txt”,ios::out);in>>i;

      數據結構大作業(yè) 121279044 伍楊

      nt;

      } all=i;if(i>0&&i<=Max){

      in>>data[j].id>>data[j].name>>data[j].type>>data[j].status>>data[j].coufor(j=1;j<=i;j++){ } } in.close();

      3)查看操作

      v void see_book(){

      FILE *fp;long NO;char bookname[20];char type[20];long date;//查看書庫記錄

      數據結構大作業(yè) 121279044 伍楊

      } if((fp=fopen(“shuku.txt”,“r”))==NULL){

      } printf(“File open error!n”);exit(0);while(!feof(fp)){ fscanf(fp,“%s%ld%s%ld”,bookname,&NO,type,&date);printf(“%-10s %-10ld %-10s %ldn”,bookname,NO,type,date);};if(fclose(fp)){

      } printf(“Can not close the file!n”);exit(0);void see_person(){ //查看所有借書記錄

      數據結構大作業(yè) 121279044 伍楊

      FILE *fp;char name[10];

      char classes[20];

      int number;char telephone[20];

      int NO;

      char bookname[20];

      int borrowdate;

      int returndate;

      fscanf(fp,“%s %s %ld %s %ld %s %ld %ld”,name,classes,&number,telephonwhile(!feof(fp)){ if((fp=fopen(“jieshujilu.txt”,“r”))==NULL){

      } printf(“File open error!n”);exit(0);e,&NO,bookname,&borrowdate,&returndate);printf(“%-5s %-5s %ld %-5s %ld %-5s %ld %ldn”,name,classes,number,telephone,NO,bookname,borrowdate,returndate);

      數據結構大作業(yè) 121279044 伍楊

      } };if(fclose(fp)){

      } printf(“Can not close the file!n”);exit(0);

      4)刪除操作

      void delete_books()

      {

      int number;void deletebooks();

      printf(“請輸入您要刪除的書編號:”);scanf(“%d”,&number);FILE *fp;struct book b;

      //刪除舊書

      數據結構大作業(yè) 121279044 伍楊

      if((fp=fopen(“shuku.txt”,“r”))==NULL){

      } printf(“不能打開此文件!n”);exit(0);while(!feof(fp)){ fscanf(fp,“%s %d %s %d”,b.bookname,&b.NO,b.type,&b.date);

      } if(b.NO==number){

      } printf(“nnt***************圖書信息*******************n”);printf(“nt圖書書名:%25s”,b.bookname);printf(“nt----------”);printf(“nt圖書編號:%25d”,b.NO);printf(“nt----------”);printf(“nt圖書類型:%23s”,b.type);printf(“nt----------”);printf(“nt到書日期:%25d”,b.date);printf(“nt----------”);

      deletebooks();

      數據結構大作業(yè) 121279044 伍楊

      }

      void deletebooks(){

      while(!feof(fp)){ fscanf(fp,“%s %d %s %d”,b.bookname,&b.NO,b.type,&b.date);if((fp=fopen(“shuku.txt”,“r”))==NULL){

      } if((fp1=fopen(“tempshuku.txt”,“w”))==NULL){

      //建立一個臨時文件

      } printf(“不能打開此文件!n”);exit(0);printf(“不能打開此文件!n”);exit(0);printf(“nn確認刪除?請再次輸入書編號:”);scanf(“%d”,&number);FILE *fp,*fp1,*fp2,*fp3;int number;struct book b;

      數據結構大作業(yè) 121279044 伍楊

      } if(b.NO==number)continue;else

      fprintf(fp1,“%s %d %s %d”,b.bookname,b.NO,b.type,b.date);fclose(fp);fclose(fp1);if((fp2=fopen(“tempshuku.txt”,“r”))==NULL){

      } if((fp3=fopen(“shuku.txt”,“w”))==NULL){

      //清空書庫

      } while(!feof(fp2)){

      //將臨時文件的內容寫人源文件

      } fscanf(fp2,“%s %d %s %d”,b.bookname,&b.NO,b.type,&b.date);fprintf(fp3,“%s %d %s %d”,b.bookname,b.NO,b.type,b.date);printf(“不能打開此文件!n”);exit(0);printf(“不能打開此文件!n”);exit(0);

      數據結構大作業(yè) 121279044 伍楊

      }

      void delete_returnbook(){

      if((fp=fopen(“jieshujilu.txt”,“r”))==NULL){

      } printf(“不能打開此文件!n”);exit(0);printf(“n請輸入所還書本的書編號:”);scanf(“%d”,&numbers);FILE *fp;int numbers;struct person p;void deletereturnbook();char choice;printf(“n

      刪除成功!n”);fclose(fp2);fclose(fp3);

      //刪除借書記錄

      數據結構大作業(yè) 121279044 伍楊

      while(!feof(fp)){

      fscanf(fp,“%s %s %ld %s %ld %s %ld %ld”,p.name,p.classes,&p.number,p.telephone,&p.NO,p.bookname,&p.borrowdate,&p.returndate);

      if(p.NO==numbers){

      printf(“nt***************圖書信息*******************n”);printf(“nt借書人姓名:%20s”,p.name);printf(“nt----------”);printf(“nt借書人班級:%20s”,p.classes);printf(“nt----------”);printf(“nt借書人學號:%20d”,p.number);printf(“nt----------”);printf(“nt借書人聯系電話:%20s”,p.telephone);printf(“nt----------”);printf(“nt圖書編號:%24d”,p.NO);printf(“nt----------”);printf(“nt圖書名稱:%23s”,p.bookname);printf(“nt----------”);printf(“nt借書日期:%25d”,p.borrowdate);printf(“nt----------”);printf(“nt還書日期:%25d”,p.returndate);

      數據結構大作業(yè) 121279044 伍楊

      }

      }

      } printf(“nt----------”);

      deletereturnbook();

      printf(“nt您想繼續(xù)嗎?(y/n)”);scanf(“ %c”,&choice);if(choice=='Y'||choice=='y'){

      } system(“cls”);delete_returnbook();fclose(fp);void deletereturnbook(){ FILE *fp,*fp1,*fp2,*fp3;struct person p;

      int numbers;printf(“nn確認刪除?請再次輸入書編號:”);

      數據結構大作業(yè) 121279044 伍楊

      scanf(“%d”,&numbers);if((fp=fopen(“jieshujilu.txt”,“r”))==NULL){

      } if((fp1=fopen(“tempbook.txt”,“w”))==NULL){

      } printf(“不能打開此文件!n”);exit(0);printf(“不能打開此文件!n”);exit(0);while(!feof(fp)){ fscanf(fp,“%s %s %d %s %d %s %d %d”,p.name,p.classes,&p.number,p.telephone,&p.NO,p.bookname,&p.borrowdate,&p.returndate);

      if(p.NO==numbers)continue;else

      fprintf(fp1,“%s %s %d %s %d %s %d %d”,p.name,p.classes,p.number,p.telephone,p.NO,p.bookname,p.borrowdat

      數據結構大作業(yè) 121279044 伍楊

      e,p.returndate);

      fscanf(fp2,“%s %s %d %s %d %s %d %d”,p.name,p.classes,while(!feof(fp2)){

      //將臨時文件寫人源文件 if((fp2=fopen(“tempbook.txt”,“r”))==NULL){

      } if((fp3=fopen(“jieshujilu.txt”,“w”))==NULL){

      } printf(“不能打開此文件!n”);exit(0);printf(“不能打開此文件!n”);exit(0);fclose(fp);fclose(fp1);} &p.number,p.telephone,&p.NO,p.bookname,&p.borrowdate,&p.returndate);

      fprintf(fp3,“%s %s %d %s %d %s %d %d”,p.name,p.數據結構大作業(yè) 121279044 伍楊

      classes,p.number,p.telephone,p.NO,p.bookname,p.borrowdate,p.returndate);

      } printf(“n

      刪除成功!n”);fclose(fp2);fclose(fp3);} 5)Main函數

      int main(void){

      do{ printf(“nnn

      圖書館管理系統(tǒng)na”);printf(“ *******************************************************n”);int choice;char choice2;struct book;struct person;

      數據結構大作業(yè) 121279044 伍楊

      printf(“ ***朱老師您好吖********功能選項: 登記******請按1,******n”);printf(“ ******************************* 查看/查詢*請按2 ******n”);printf(“ ******************************* 刪除***** 請按3 ******n”);printf(“ ******************************* 退出***** 請按0 ******n”);printf(“ *******************************************************nnn”);printf(“

      請選擇功能:”);scanf(“%d”,&choice);switch(choice){ case 1:

      printf(“

      登記選項:新書登記請按1,借書登記請按2,返回請按3n”);printf(“請選擇:”);scanf(“%d”,&choice);switch(choice){ case 1:

      system(“cls”);

      //清屏 printf(“新書資料登記:nn”);new_book();

      //新書登記 printf(“登記完畢!n”);printf(“n”);scanf(“ %c”,&choice2);system(“cls”);break;

      數據結構大作業(yè) 121279044 伍楊

      case 2:

      system(“cls”);printf(“借書資料登記:nn”);new_person();

      //借書登記 printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 3:

      } break;system(“cls”);break;

      case 2: printf(“

      查看/查詢選項:書庫查看請按1,總借書記錄查看請按2,到期記錄查詢請按3,返回請按4n”);

      printf(“請選擇:”);scanf(“%d”,&choice);switch(choice){ case 1:

      system(“cls”);printf(“歡迎朱老師進入書庫!nn”);

      數據結構大作業(yè) 121279044 伍楊

      printf(“書名

      書編號

      類型

      到書日期n”);printf(“-----------n”);see_book();

      //書庫顯示 printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 2:

      system(“cls”);printf(“歡迎朱老師進入借書記錄!nn”);printf(“姓名

      班級 學號 聯系電話 書編號 書名

      借書日期 到書日期n”);

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

      //借書記錄顯示

      printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 3:

      system(“cls”);search_person();

      //顯示符合記錄 printf(“n press anykey ”);

      數據結構大作業(yè) 121279044 伍楊

      scanf(“ %c”,&choice2);system(“cls”);break;case 4:

      } break;system(“cls”);break;case 3: printf(“

      刪除選項:舊書刪除請按1,借書記錄刪除請按2,返回請按3n”);

      printf(“請選擇:”);scanf(“%d”,&choice);switch(choice){ case 1:

      system(“cls”);delete_books();

      //刪除ing printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 2:

      數據結構大作業(yè) 121279044 伍楊

      }

      system(“cls”);delete_returnbook();

      //刪除ing printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 3:

      } break;system(“cls”);break;case 0:

      } system(“cls”);}while(choice!= 0);return 0;

      數據結構大作業(yè) 121279044 伍楊

      四、調試與測試

      主菜單

      登記

      數據結構大作業(yè) 121279044 伍楊

      查看

      刪除

      生成的文件內信息

      數據結構大作業(yè) 121279044 伍楊五、五心得體會

      經過這次大作業(yè),我覺得代碼的編寫,最主要的的是編程思想,語言其實不是太重要,思路最重要!

      六、用戶手冊

      程序執(zhí)行文件為 lib sys.exe,打開執(zhí)行文件后按提示操作即可

      第五篇:C++課程設計 教職工信息管理系統(tǒng)源代碼

      教職工信息管理系統(tǒng)源碼

      #include #include #include #include

      #define maxsize 100 fstream iofile;//文件指針

      class Time //時間類 {

      public:

      int year;

      int month;

      int day;};

      class Telem //個人信息 {

      public:

      char name[20];

      char sex[10];

      Time birthtime;//組合Time類

      char num[20];

      char wage[20];

      Time worktime;

      int year;

      char department[20];

      friend istream& operator>>(istream& input,Telem& T);

      friend ostream& operator<<(ostream& output,Telem& T);

      friend int operator-(Time & t1,Time & t2);};

      class People:virtual public Telem //雇員類 {

      public:

      People();

      virtual void AddF()=0;//添加

      virtual void Addall()=0;

      virtual void Add()=0;

      virtual void Display();//輸出數組的內容

      virtual void Displaypart(char p[]);

      virtual void Findname(char n[]);

      virtual void Findyear(int);

      virtual void Del(char n[])=0;

      virtual void Del(int);protected:

      Telem data[maxsize];

      Time now;

      int length;};

      class Teacher:virtual public People //派生虛基類 {

      public:

      virtual void AddF();

      virtual void Addall();

      virtual void Add();

      virtual void Display();

      virtual void Del(int i);

      virtual void Del(char n[]);};

      class worker:virtual public People //派生虛基類 {

      public:

      virtual void AddF();

      virtual void Addall();

      virtual void Add();

      virtual void Display();

      virtual void Del(int i);

      virtual void Del(char n[]);};

      People::People()//系統(tǒng)自動生成的構造函數 {

      length=0;

      now.year=2010;

      now.month=7;

      now.day=6;}

      void People::Display()//引用 {

      int i;

      for(i=0;i

      cout<

      void People::Displaypart(char p[])//引用數組

      {

      int i,c;

      for(i=0;i

      if(strcmp(data[i].wage,p)==0)

      {

      cout<<“輸出選擇姓名1 性別2 編號3 工資4 出生日期5 工作時間6 年齡7 系別8 退出選擇9”<

      while(cin>>c)

      {

      switch(c)

      {

      case 1: cout<<“姓名:”<

      case 2: cout<<“性別:”<

      case 3: cout<<“編號:”<

      case 4: cout<<“工資:”<

      case 5: cout<<“出生日期:”<

      case 6: cout<<“工作時間:”<

      case 7: cout<<“年齡:”<

      case 8: cout<<“系別:”<

      case 9: goto loop;

      default:cout<<“操作錯誤......”<

      }

      }

      loop:;

      } }

      void People::Findname(char n[])//引用 {

      int i;

      for(i=0;i

      if(strcmp(data[i].name,n)==0)//對象引用

      cout<

      void People::Findyear(int y){

      int i;

      for(i=0;i

      if(data[i].year==y)

      cout<

      void People::Del(int i){

      int j;

      if(i<1||i>length)

      cout<<“不存在第”<

      for(j=i;j

      data[j-1]=data[j];

      length--;}

      void worker::AddF(){

      int flag=0;

      iofile.open(“worker_information.txt”,ios::in|ios::binary);//文件的打開與關閉

      while(iofile.seekg(ios::cur))

      {

      iofile.seekg(length*sizeof(data[length]),ios::beg);

      iofile.read((char*)&data[length],sizeof(data[length]));//文件的隨機訪問

      length++;

      if(length==maxsize)

      {

      flag=1;

      goto loop;

      }

      }

      People::Del(length);

      cout<<“添加人員信息成功......”<

      loop:

      if(1==flag)

      cout<<“人員信息儲存空間已滿......”<

      iofile.close();}

      void worker::Addall(){

      char ans;

      int flag=0;

      iofile.open(“worker_information.txt”,ios::out|ios::binary);

      do

      {

      cin>>data[length];

      data[length].year=now-data[length].birthtime;

      iofile.write((char*)&data[length],sizeof(data[length]));

      cout<<“添加人員信息成功......”<

      length++;

      if(length==maxsize)

      {

      flag=1;

      goto loop;

      }

      cout<<“contine(Y|N)?”;

      cin>>ans;

      }while('y'==ans||'Y'==ans);loop:

      if(1==flag)

      cout<<“人員信息儲存空間已滿......”<

      iofile.close();}

      void worker::Add(){

      int flag=0;

      iofile.open(“worker_information.txt”,ios::app|ios::out|ios::binary);

      if(length==maxsize)

      {

      flag=1;

      goto loop;

      }

      cin>>data[length];

      data[length].year=now-data[length].birthtime;

      iofile.write((char*)&data[length],sizeof(data[length]));

      cout<<“添加人員信息成功......”<

      length++;

      loop:

      if(1==flag)

      cout<<“人員信息儲存空間已滿......”<

      iofile.close();}

      void worker::Display(){

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆工人信息 ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      if(0==length)

      cout<<“無......”<

      int i;

      for(i=0;i

      cout<

      int i,j,k;

      for(i=0;i

      if(strcmp(data[i].name,n)==0){

      k=i+1;break;}

      if(k<1)

      cout<<“不存在姓名”<

      for(j=k;j

      data[j-1]=data[j];

      length--;

      cout<<“刪除人員信息成功......”<

      void worker::Del(int i){

      int j;

      if(i<1||i>length)

      cout<<“不存在第”<

      for(j=i;j

      data[j-1]=data[j];

      length--;

      cout<<“刪除成功......”<

      }

      void Teacher::AddF(){

      int flag=0;

      iofile.open(“Teacher_information.txt”,ios::in|ios::binary);

      while(iofile.seekg(sizeof(data[length]),ios::cur))

      {

      if(iofile.seekg(length*sizeof(data[length]),ios::beg))

      iofile.read((char*)&data[length],sizeof(data[length]));

      else

      break;

      length++;

      if(length==maxsize)

      {

      flag=1;

      goto loop;

      }

      }

      People::Del(length);

      cout<<“添加人員信息成功......”<

      if(1==flag)

      cout<<“人員信息儲存空間已滿......”<

      iofile.close();}

      void Teacher::Addall(){

      char ans;

      int flag=0;

      iofile.open(“Teacher_information.txt”,ios::in|ios::out|ios::binary);

      do

      {

      cin>>data[length];

      data[length].year=now-data[length].birthtime;

      iofile.write((char*)&data[length],sizeof(data[length]));

      cout<<“添加人員信息成功......”<

      length++;

      if(length==maxsize)

      {

      flag=1;

      goto loop;

      }

      cout<<“contine(Y|N)?”;

      cin>>ans;

      }while('y'==ans||'Y'==ans);loop:

      if(1==flag)

      cout<<“人員信息儲存空間已滿......”<

      iofile.close();}

      void Teacher::Add(){

      int flag=0;

      iofile.open(“Teacher_information.txt”,ios::app|ios::out|ios::binary);

      if(length==maxsize)

      {

      flag=1;

      goto loop;

      }

      cin>>data[length];

      data[length].year=now-data[length].birthtime;

      iofile.write((char*)&data[length],sizeof(data[length]));

      cout<<“添加人員信息成功......”<

      length++;loop:

      if(1==flag)

      cout<<“人員信息儲存空間已滿......”<

      iofile.close();}

      void Teacher::Display(){

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆教師信息 ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      if(0==length)

      cout<<“無......”<

      int i;

      for(i=0;i

      cout<

      void Teacher::Del(char n[]){

      int i,j,k;

      for(i=0;i

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

      {

      k=i+1;break;

      }

      if(k<1)cout<<“不存在姓名”<

      for(j=k;j

      data[j-1]=data[j];

      length--;

      cout<<“刪除人員信息成功......”<

      void Teacher::Del(int i){

      int j;

      if(i<1||i>length)

      cout<<“不存在第”<

      for(j=i;j

      data[j-1]=data[j];

      length--;

      cout<<“刪除成功......”<

      istream& operator>>(istream& input,Telem& T){

      int y,m,d;

      cout<<“請輸入姓名(以*結尾):”<

      input.getline(T.name,20,'*');

      cout<<“請輸入性別(以*結尾 男或女):”<

      input.getline(T.sex,10,'*');

      cout<<“編號(以*結尾):”<

      input.getline(T.num,20,'*');

      cout<<“工資(以*結尾):”<

      input.getline(T.wage,20,'*');

      cout<<“請輸入出生日期:”<

      input>>y>>m>>d;

      T.birthtime.year=(y>=1900&&y<=2100)?y:1900;

      T.birthtime.month=(m>=1&&m<=12)?m:1;

      T.birthtime.day=(d>=1&&d<=31)?d:1;

      cout<<“請輸入系別(以*結尾):”<

      input.getline(T.department,20,'*');

      cout<<“參加工作時間:”<

      input>>y>>m>>d;

      T.worktime.year=(y>=1900&&y<=2100)?y:1900;

      T.worktime.month=(m>=1&&m<=12)?m:1;

      T.worktime.day=(d>=1&&d<=31)?d:1;

      return input;}

      ostream& operator<<(ostream& output,Telem& T){

      cout<<“姓名:”;

      output<

      cout<<“性別:”;

      output<

      cout<<“編號:”;

      output<

      cout<<“工資:”;

      output<

      cout<<“出生日期:”;

      output<

      cout<<“系別:”;

      output<

      cout<<“參加工作時間:”;

      output<

      cout<<“年齡:”;

      output<

      return output;}

      int operator-(Time & t1,Time & t2){

      return t1.year-t2.year;}

      void Showmenu(){

      cout<

      cout<<“

      歡 迎 進 入 教 職 工 信 息 管 理 系 統(tǒng)”<

      cout<<“

      2010 年7月7日發(fā)布”<<“

      版權所有: swa”<

      cout<<“

      ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★人員信息管理系統(tǒng)★ ☆ ★ ☆ ★ ☆ ★ ☆ ★”<

      cout<<“

      1-從鍵盤錄入全部人員記錄

      ☆ ”<

      cout<<“

      ☆ 2-增加一位人員記錄

      ★”<

      cout<<“

      3-顯示全部人員記錄

      ☆”<

      cout<<“

      ☆ 4-按系別輸出人員信息(可選)★ ”<

      cout<<“

      5-按姓名或年齡檢索所有信息☆ ”<

      cout<<“

      ☆ 6-顯示菜單目錄

      ★ ”<

      cout<<“

      7-結束程序運行

      ☆ ”<

      cout<<“

      ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      int main(){

      Teacher tea;

      worker stu;

      People *pt=&tea;

      People *ps=&stu;

      int c=0,k=0,l=0,i=0;

      char nam[20],part[20];Showmenu();

      for(;;)

      {

      cout<<“請根據菜單執(zhí)行相應操作: ”;

      cin>>c;

      switch(c)

      {

      case 1:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★錄入全部人員記錄 ★ ☆ ★ ☆ ★ ☆ ★”<

      cout<<“ ★ ☆ ★ ☆ ★從鍵盤輸入教師信息 ☆ ★ ☆ ★ ☆”<

      pt->Addall();

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆從鍵盤輸入工人信息 ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      ps->Addall();

      break;

      }

      case 2:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆從鍵盤增加一位人員記錄 ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆教師操作請按1 工人操作請按2 ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      cin>>k;

      if(1==k)

      pt->Add();

      else if(2==k)

      ps->Add();

      else

      cout<<“操作錯誤...”<

      break;

      }

      case 3:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆顯示全部人員記錄 ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      pt->Display();

      ps->Display();

      break;

      }

      case 4:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆按部門輸出人員信息(可選)★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      cout<<“ ★ ☆ ★ ☆ ★ ☆教師操作請按1 工人操作請按2 ★ ☆ ★ ☆ ★ ☆”<

      cin>>k;

      if(1==k)

      {

      cout<<“請輸入要輸出人員的系別(以*結尾):”<

      pt->Displaypart(part);

      }

      else if(2==k)

      {

      cout<<“請輸入要輸出人員的系別(以*結尾):”<

      ps->Displaypart(part);

      }

      else

      cout<<“操作錯誤......”<

      break;

      }

      case 5:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★按姓名或年齡檢索所有信息 ★ ☆ ★ ☆ ★ ☆ ★”<

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★按姓名查找1 按年齡查找2 ★ ☆ ★ ☆ ★ ☆ ★”<

      cin>>k;

      if(1==k)

      {

      cout<<“按姓名查找1 按年齡查找2”<>l;

      if(1==l)

      {

      cout<<“請輸入要查找人員的姓名(以*結尾):”<

      pt->Findname(nam);

      }

      else if(2==l)

      {

      cout<<“請輸入要查找人的年齡:”<>i;

      pt->Findyear(i);

      }

      else

      cout<<“操作錯誤......”<

      }

      else if(2==k)

      {

      cout<<“按姓名查找1 按年齡查找2”<>l;

      if(1==l)

      {

      cout<<“請輸入要查找人員的姓名(以*結尾):”<

      ps->Findname(nam);

      }

      else if(2==l)

      {

      cout<<“請輸入要查找人的年齡:”<>i;

      ps->Findyear(i);

      }

      else

      cout<<“操作錯誤......”<

      }

      else

      cout<<“操作錯誤......”<

      break;

      }

      case 6:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆顯示菜單目錄 ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      Showmenu();

      break;

      }

      case 7:

      {

      cout<<“ ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆結束程序運行 ★ ☆ ★ ☆ ★ ☆ ★ ☆ ★ ☆”<

      exit(0);

      }

      default:cout<<“操作錯誤......”<

      }

      }

      return 0;}

      下載C語言課程設計火車票系統(tǒng)源代碼word格式文檔
      下載C語言課程設計火車票系統(tǒng)源代碼.doc
      將本文檔下載到自己電腦,方便修改和收藏,請勿使用迅雷等下載。
      點此處下載文檔

      文檔為doc格式


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

      相關范文推薦

        航空售票系統(tǒng)+C++課程設計源代碼

        #include #include #define M 5//每種飛機票的總數目 #define N 3//飛機票的總數目 class Plane {private: char name[40];//終點站名int number;//航班號int Number;//......

        c++課程設計:教務管理系統(tǒng)源代碼

        #include #include using namespace std; class Person { public: Person(string n):name(n){} virtual void show(){} ~Person(){} protected: string name; }; class......

        c語言課程設計-文件加密解密(含源代碼)

        C 語 言 課 程 設 計 實 驗 報 告 實驗名稱:文件加密解密 院系:軟件學院 學號: 年9月3日—9月17日 日期:2012 一:設計題目 1:設計圖形用戶界面。 2:對文件進行加密并對加密文件進......

        C語言課程設計 職工信息管理系統(tǒng) 單鏈表實現程序源代碼

        //C語言課程設計 職工信息管理系統(tǒng)—單鏈表實現 #include "stdio.h" #include "stdlib.h" #include "string.h" int saveflag=0; /*是否需要存盤的標志變量*/ struct empl......

        課程設計火車票售票系統(tǒng)的需求分析

        二.需求分析 經過對程序設計題目的分析可知,整個程序的設計實現大致分為八個模塊,每一個模塊對應一個函數。在這些函數當中,添加車次數據函數、售票函數、查詢總額函數的實現嚴......

        人事管理系統(tǒng)源代碼

        #include #include #include #define N 100 struct member_info { char xm[7]; char xb[3]; char sr[15]; char whcd[13]; char zc[17]; char sfzh[19]; char lxdh[12];......

        C語言機票訂票管理系統(tǒng)源代碼

        #include //標準輸入、輸出頭文件 #include //包含字符串函數處理頭文件 #include //包含access函數的頭文件 #include #include #include #include #define N 9999 //定......

        c語言實現機票管理系統(tǒng)源代碼

        /*1、用戶和管理員及航班信息請以英文字母或數字輸入*/ /*2、管理員賬戶為:boss,密碼為:123。保存在txt文件中,需要修改請于程序中修改*/ /*3、部分文件讀寫為二進制讀寫,所以打......