公交车管理系统C语言
生活随笔
收集整理的這篇文章主要介紹了
公交车管理系统C语言
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
翻網(wǎng)盤的時(shí)候翻出來大一做的一個(gè)公交車管理系統(tǒng)的C語言課設(shè),給大家分享下
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<conio.h> #include<windows.h> #define len sizeof(struct bus) char password1[100]={'1','2','3','4','5','6'}; //定義結(jié)構(gòu)體類型 struct bus {struct bus *next;/*連接站點(diǎn)指針*/ struct bus *next2;/*連接公交車指針*/int num;//站號(hào) char name[100];//站名 }; /*創(chuàng)建第一輛公交車*/ struct bus* creat() {struct bus *p1,*p2,*head=NULL;char n[100];printf("請(qǐng)輸入該線路總站數(shù)以及車次\n");p1=p2=(struct bus*)malloc(len);scanf("%s%s",n,p1->name);//輸入的字符串以#結(jié)尾//先輸入字符串,如果字符串不為#,再將其轉(zhuǎn)化為數(shù)字賦給結(jié)構(gòu)體里的序號(hào) while(n[0]!='#'){//將字符串轉(zhuǎn)化為數(shù)字形式 p1->num=atoi(n);if(head==NULL){head=p1;}else{p2->next=p1;p2=p1;}p1=(struct bus*)malloc(len);printf("請(qǐng)輸入站點(diǎn)序號(hào)及站點(diǎn)信息(輸入#結(jié)束輸入)\n");scanf("%s%s",n,p1->name);}p2->next=NULL;return head; } /*創(chuàng)建第二輛公交車*/ struct bus* creatbus(struct bus *head1) {struct bus *p1,*p2,*head=NULL;char n[100];printf("請(qǐng)輸入該線路總站數(shù)以及車次\n");p1=p2=(struct bus*)malloc(len);scanf("%s%s",n,p1->name);while(n[0]!='#'){p1->num=atoi(n);if(head==NULL){head=p1;}else{p2->next=p1;p2=p1;}p1=(struct bus*)malloc(len);printf("請(qǐng)輸入站點(diǎn)序號(hào)及站點(diǎn)信息(輸入#結(jié)束輸入)\n");scanf("%s%s",n,p1->name);}p2->next=NULL;head1->next2=head;return head; } /*顯示函數(shù)*/ void list(struct bus *head) {struct bus *temp;temp=head;while(temp!=NULL){if(temp==head)printf("\t\t總站數(shù):%d 車次:%s\n",temp->num,temp->name);elseprintf("\t\t站點(diǎn)序號(hào):%d 站點(diǎn)名稱:%s\n",temp->num,temp->name);temp=temp->next;}} /*刪除站點(diǎn)函數(shù)*/ struct bus* del(struct bus *head) {struct bus *p1,*p2;char n[100];printf("\t\t輸入你要?jiǎng)h除站點(diǎn)的名稱\n");printf("\t\t");scanf("%s",n);if(head==NULL)printf("鏈表為空\(chéng)n");else{p1=head;while(strcmp(n,p1->name)!=0&&p1->next!=NULL){p2=p1;p1=p1->next;} if(strcmp(n,p1->name)==0){if(head==p1){head=head->next;}else{p2->next=p1->next;}p1=p1->next;while(p1!=NULL){p1->num=p1->num-1;p1=p1->next;}}else{printf("\t\t沒有該站點(diǎn)\n");}}return head; }/*加入新站點(diǎn)*/struct bus* insert(struct bus *head){struct bus *temp,*p1,*p2;int n;printf("\t\t請(qǐng)輸入你想添加到那個(gè)站點(diǎn)前(站點(diǎn)序號(hào))\n");printf("\t\t");scanf("%d",&n);printf("\t\t請(qǐng)輸入站點(diǎn)序號(hào)及站點(diǎn)信息\n");temp=(struct bus*)malloc(len);printf("\t\t");scanf("%d%s\n",&temp->num,temp->name);temp->next=NULL;if(head==NULL){head=temp;}else{p1=head;while(n!=p1->num&&p1->next!=NULL){p2=p1;p1=p1->next;}if(n==p1->num){ p2->next=temp;temp->next=p1;while(p1!=NULL){p1->num=p1->num+1;p1=p1->next;} }else{printf("\t\t沒有該節(jié)點(diǎn)");}}return head;}//保存數(shù)據(jù) void save(struct bus *head1,struct bus *head2) {FILE *fp;struct bus *p1,*p2,*p3; p3=(struct bus*)malloc(len);p3->num=21568;if((fp=fopen("bus.txt","wb"))==NULL) { printf("打不開文件\n"); exit(0);}else{printf("\n保存中\(zhòng)n"); p1=head1;p2=head2;while(1) { fwrite(p1,len,1,fp); p1=p1->next;if(p1==NULL){break;}}fwrite(p3,len,1,fp);while(1) { fwrite(p2,len,1,fp); p2=p2->next;if(p2==NULL){break; }}fclose(fp);printf("保存成功\n");} } //讀取車站信息 struct bus* load() {struct bus *p1,*p2,*head1=NULL,*p3,*p4,*head2=NULL; FILE *fp; p1=(struct bus*)malloc(len); p3=(struct bus*)malloc(len);head1=p1; head2=p3;fp=fopen("bus.txt","rb");while(!feof(fp)) { if(fread(p1,sizeof(struct bus),1,fp)!=1) {break; }if(p1->num==21568){break;}p1->next=(struct bus*)malloc(len); p2=p1; p1=p1->next; }p2->next=NULL;while(!feof(fp)) { if(fread(p3,sizeof(struct bus),1,fp)!=1) break;p3->next=(struct bus*)malloc(len); p4=p3; p3=p3->next; }p4->next=NULL;fclose(fp); printf("打開文件夾成功\n");head1->next2=head2;return head1; } /*修改站點(diǎn)信息函數(shù)*/ struct bus* edit(struct bus *head) {struct bus *p1,*p2;char n[100];printf("\t\t請(qǐng)輸入您想修改的站點(diǎn)名稱\n");printf("\t\t");scanf("%s",n);if(head==NULL){printf("\t\t信息為空\(chéng)n"); } else{p1=head;while(strcmp(n,p1->name)!=0&&p1->next!=NULL){p2=p1;p1=p1->next;}if(strcmp(n,p1->name)==0){printf("\t\t請(qǐng)輸入修改后的站點(diǎn)名稱\n");printf("\t\t");scanf("%s",p1->name);}else{printf("\t\t沒有找到該站點(diǎn)");}}return head; } void pa(); /*管理員菜單*/ void manage(struct bus *head) {int n;int c,e;while(1){printf("\t\t-------------------------!歡迎您,管理員!--------------------------------\n");printf("\t\t---------------------------------------------------------------------------\n");printf("\t\t-------------------------輸入1創(chuàng)建新公交線路-------------------------------\n");printf("\t\t-------------------------輸入2刪除公交站點(diǎn)---------------------------------\n");printf("\t\t-------------------------輸入3插入新公交站點(diǎn)-------------------------------\n");printf("\t\t-------------------------輸入4儲(chǔ)存公交線路---------------------------------\n");printf("\t\t-------------------------輸入5輸出站點(diǎn)信息---------------------------------\n");printf("\t\t-------------------------輸入6修改站點(diǎn)信息---------------------------------\n");printf("\t\t-------------------------輸入7修改密碼-------------------------------------\n");printf("\t\t-------------------------輸入8返回主菜單-------------------------------------\n");printf("\t\t---------------------------------------------------------------------------\n");printf("\t\t");scanf("%d",&n);switch(n){case 1:head=creat();break;case 2:while(1){printf("\t\t請(qǐng)選擇你要操作的公交車102/29\n");printf("\t\t");scanf("%d",&c);if(c==102){head=del(head);}else{head->next2=del(head->next2);}printf("\t\t是否要繼續(xù)刪除1/0\n");printf("\t\t");scanf("%d",&e);if(e==0){break;}}break;case 3:printf("\t\t請(qǐng)選擇你要操作的公交車102/29\n");printf("\t\t");scanf("%d",&c);if(c==102){head=insert(head);}else{head->next2=insert(head->next2);}break;case 4:save(head,head->next2);break;case 5:printf("\t\t請(qǐng)選擇你要輸出的公交車102/29\n");printf("\t\t");scanf("%d",&c);if(c==102){list(head);}else{list(head->next2);}break;case 6:printf("\t\t請(qǐng)選擇你要修改的的公交車102/29\n");printf("\t\t");scanf("%d",&c);if(c==102){head=edit(head);}else{head->next2=edit(head->next2);}break; case 7:/*修改密碼*/pa();break;default:return;}if(n==8)break;} } void search(struct bus *head); /*乘客查詢菜單*/ void find(struct bus *head) {int n,c;printf("\t\t---------------------------------------------------------------------------\n");printf("\t\t------------------------輸入1查詢公交線路----------------------------------\n");printf("\t\t-------------------------輸入2查詢公交車途經(jīng)的公交站點(diǎn)---------------------\n");printf("\t\t-------------------------輸入3輸出公交線路---------------------------------\n");printf("\t\t---------------------------------------------------------------------------\n");printf("\t\t");scanf("%d",&n);switch(n){case 1:search(head);break;case 2:head=del(head);break;case 3:printf("\t\t請(qǐng)選擇你要輸出的公交車102/29\n");printf("\t\t");scanf("%d",&c);if(c==102){list(head);}else{list(head->next2);}break;} } void password(struct bus *head) {char a[100];int i;printf("\t\t請(qǐng)輸入您的密碼\n");printf("\t\t");for(i=0;i<100;i++){a[i]=getch();if(a[i]=='\r')break;printf("*");}a[i]='\0';printf("\n");if(strcmp(a,password1)==0){manage(head);}else{printf("密碼錯(cuò)誤\n");} } //修改密碼函數(shù) void pa() {char a[100],b[100],c[100];int i;while(1){//判斷原密碼是否正確 printf("請(qǐng)輸入您的原密碼\n");for(i=0;i<100;i++){a[i]=getch();if(a[i]=='\r'){break;}printf("*");}a[i]='\0';printf("\n");if(strcmp(a,password1)!=0){printf("密碼錯(cuò)誤,請(qǐng)?jiān)俅屋斎?#34;);}if(strcmp(a,password1)==0){//輸入密碼為原密碼時(shí)跳出循環(huán) break;}}//兩次密碼不一致 while(1){printf("請(qǐng)輸入您修改后的密碼\n");for(i=0;i<100;i++){b[i]=getch();if(b[i]=='\r'){break;}printf("*");}b[i]='\0';printf("\n");printf("請(qǐng)?jiān)俅屋斎胄薷暮蟮拿艽a\n");for(i=0;i<100;i++){c[i]=getch();if(c[i]=='\r'){ break;} printf("*");}c[i]='\0';printf("\n");if(strcmp(b,c)!=0){printf("兩次輸入的密碼不一致,請(qǐng)重新輸入\n");}else{//兩次密碼輸入一致時(shí)跳出循環(huán) break; }}strcpy(password1,c);printf("修改成功\n"); } //鏈表逆序函數(shù) struct bus *oppsite(struct bus *head) {int c=head->num,d;struct bus *p1,*p2,*p3;while(c--){p1=head;//p1指向第一個(gè) p2=head->next;//p2指向第二個(gè) p3=p2->next;//p3指向第三個(gè) d=c;while(d!=0){d--;if(p3!=NULL&&p1!=NULL&&p2!=NULL){if(p2->num<p3->num){p2->next=p3->next;//如果第二個(gè)大于第三個(gè)兩個(gè)交換,p2的next給p3 p1->next=p3;//p1的下個(gè)等于p3 p3->next=p2; //p3后面為p2,則p2在三位,p3在二位 p1=p3;//p1再?gòu)脑鹊亩恢胮3開始p3=p2->next;//p3為p2的后面第四個(gè)位置 }else{p1=p2;//如果p2小于p3整體向后移 p2=p3;p3=p3->next;}}}}return head;} //用戶查詢公交線路函數(shù) void search(struct bus *head) {struct bus *head1,*head2,*o1,*o2;struct bus *p1,*p2,*p3,*p4,*p5,*p6;struct bus *q1,*q2,*q3,*q4,*q5,*q6,*p7;int flag[4],i,j,flag2[4];char a[100],b[100];for(i=0;i<4;i++){flag[i]=0;}head1=head;head2=head->next2;printf("\t\t請(qǐng)輸入您的起點(diǎn)\n");printf("\t\t");scanf("%s",a);printf("\t\t請(qǐng)輸入您的終點(diǎn)\n");printf("\t\t");scanf("%s",b);// p1先是公交1的頭結(jié)點(diǎn),然后利用P1遍歷公交1鏈表查找,P2記錄P1找到的位置。//p3用于遍歷公交1中的終點(diǎn) P4記錄P3最終位置 //p6也用來記錄P1的位置,之后再利用P6查找兩輛公交車相同站點(diǎn) // q1先是公交1的頭結(jié)點(diǎn),然后利用q1遍歷公交1鏈表查找,q2記錄q1找到的位置//q3用來遍歷公交2的結(jié)點(diǎn)的終點(diǎn) p1=head1;p3=head1;p5=head1;q1=head2;q5=head2;q3=head2; /*--------------------------------------------正序------------------------------*/ //找第一輛公交車的起點(diǎn)while(strcmp(a,p1->name)!=0&&p1->next!=NULL){p1=p1->next;}if(strcmp(a,p1->name)==0){//如果找到,則標(biāo)記變量為1 flag[0]=1;p2=p1;p6=p1;}//找第一輛公交車的終點(diǎn) while(strcmp(b,p3->name)!=0&&p3->next!=NULL){p3=p3->next;}if(strcmp(b,p3->name)==0){flag[1]=1;p4=p3;p7=p3;}//找第二輛公交車的起點(diǎn) while(strcmp(a,q1->name)!=0&&q1->next!=NULL){q1=q1->next;}if(strcmp(a,q1->name)==0){flag[2]=1;q2=q1;q6=q1;}//找第二輛公交車的終點(diǎn) while(strcmp(b,q3->name)!=0&&q3->next!=NULL){q3=q3->next;}if(strcmp(b,q3->name)==0){flag[3]=1;q4=q3;}//判斷正逆序 //如果為正序,不進(jìn)行操作,如果為逆序,將鏈表進(jìn)行逆序操作 //第一輛公交車 if(flag[1]==1&&flag[0]==1){//同一輛車上判斷站點(diǎn)序號(hào)大小來確定正序逆序 if(p1->num>p3->num){head1=oppsite(head1);p1=head1;p3=head1;//------------------------------------while(strcmp(a,p1->name)!=0&&p1->next!=NULL){p1=p1->next;}if(strcmp(a,p1->name)==0){//如果找到,則標(biāo)記變量為1 flag[0]=1;p2=p1;p6=p1;}//找第一輛公交車的終點(diǎn) while(strcmp(b,p3->name)!=0&&p3->next!=NULL){p3=p3->next;}if(strcmp(b,p3->name)==0){flag[1]=1;p4=p3;p7=p3;}//---------------------------------------------------- }}//第二輛公交車判斷開始 if(flag[2]==1&&flag[3]==1){if(q1->num>q3->num){head2=oppsite(head2);q1=head2;q3=head2; //--------------------------------------//找第二輛公交車的起點(diǎn) while(strcmp(a,q1->name)!=0&&q1->next!=NULL){q1=q1->next;}if(strcmp(a,q1->name)==0){flag[2]=1;q2=q1;q6=q1;}//找第二輛公交車的終點(diǎn) while(strcmp(b,q3->name)!=0&&q3->next!=NULL){q3=q3->next;}if(strcmp(b,q3->name)==0){flag[3]=1;q4=q3;}//-------------------------------------}}//----第二輛結(jié)束 //-----起點(diǎn)在第一輛,終點(diǎn)在第二輛 if(flag[0]==1&&flag[1]==0&&flag[2]==0&&flag[3]==1){o1=head1;while(1){o2=head2;while(1){if(strcmp(o1->name,o2->name)==0||o2->next==NULL){break;}o2=o2->next;}if(strcmp(o1->name,o2->name)==0||o1->next==NULL){break;}o1=o1->next;}if(p1->num>o1->num&&q3->num<o1->num){head1=oppsite(head1);head2=oppsite(head2);p1=head1;q3=head2;//找第一輛公交車的起點(diǎn)while(strcmp(a,p1->name)!=0&&p1->next!=NULL){p1=p1->next;}if(strcmp(a,p1->name)==0){//如果找到,則標(biāo)記變量為1 flag[0]=1;p2=p1;p6=p1;}//找第二輛公交車的終點(diǎn) while(strcmp(b,q3->name)!=0&&q3->next!=NULL){q3=q3->next;}if(strcmp(b,q3->name)==0){flag[3]=1;q4=q3;} }if(p1->num<o1->num&&q3->num>o1->num){//正序 }if(p1->num>o1->num&&q3->num>o1->num){//先逆序再正序head1=oppsite(head1);p1=head1;q3=head2;//找第一輛公交車的起點(diǎn)while(strcmp(a,p1->name)!=0&&p1->next!=NULL){p1=p1->next;}if(strcmp(a,p1->name)==0){//如果找到,則標(biāo)記變量為1 flag[0]=1;p2=p1;p6=p1;}//找第二輛公交車的終點(diǎn) while(strcmp(b,q3->name)!=0&&q3->next!=NULL){q3=q3->next;}if(strcmp(b,q3->name)==0){flag[3]=1;q4=q3;}}if(p1->num<o1->num&&q3->num<o1->num){//先正序再逆序head2=oppsite(head2);p1=head1;q3=head2;//找第一輛公交車的起點(diǎn)while(strcmp(a,p1->name)!=0&&p1->next!=NULL){p1=p1->next;}if(strcmp(a,p1->name)==0){//如果找到,則標(biāo)記變量為1 flag[0]=1;p2=p1;p6=p1;}//找第二輛公交車的終點(diǎn) while(strcmp(b,q3->name)!=0&&q3->next!=NULL){q3=q3->next;}if(strcmp(b,q3->name)==0){flag[3]=1;q4=q3;} }}//-----起點(diǎn)在第二輛,終點(diǎn)在第一輛 if(flag[0]==0&&flag[1]==1&&flag[2]==1&&flag[3]==0){o1=head1;while(1){o2=head2;while(1){if(strcmp(o1->name,o2->name)==0||o2->next==NULL){break;}o2=o2->next;}if(strcmp(o1->name,o2->name)==0||o1->next==NULL){break;}o1=o1->next;}if(q1->num<o1->num&&p3->num>o1->num){//正序 }if(q1->num>o1->num&&p3->num>o1->num){//先逆后正head1=oppsite(head1);q1=head2;p3=head1;//找第一輛公交車的終點(diǎn) while(strcmp(b,p3->name)!=0&&p3->next!=NULL){p3=p3->next;}if(strcmp(b,p3->name)==0){flag[1]=1;p4=p3;p7=p3;}//找第二輛公交車的起點(diǎn) while(strcmp(a,q1->name)!=0&&q1->next!=NULL){q1=q1->next;}if(strcmp(a,q1->name)==0){flag[2]=1;q2=q1;q6=q1;}}if(q1->num<o1->num&&p3->num<o1->num){//先正后逆 head2=oppsite(head2);q1=head2;p3=head1;//找第一輛公交車的終點(diǎn) while(strcmp(b,p3->name)!=0&&p3->next!=NULL){p3=p3->next;}if(strcmp(b,p3->name)==0){flag[1]=1;p4=p3;p7=p3;}//找第二輛公交車的起點(diǎn) while(strcmp(a,q1->name)!=0&&q1->next!=NULL){q1=q1->next;}if(strcmp(a,q1->name)==0){flag[2]=1;q2=q1;q6=q1;}}if(q1->num>o1->num&&p3->num<o1->num){head1=oppsite(head1);head2=oppsite(head2);q1=head2;p3=head1;//找第一輛公交車的終點(diǎn) while(strcmp(b,p3->name)!=0&&p3->next!=NULL){p3=p3->next;}if(strcmp(b,p3->name)==0){flag[1]=1;p4=p3;p7=p3;}//找第二輛公交車的起點(diǎn) while(strcmp(a,q1->name)!=0&&q1->next!=NULL){q1=q1->next;}if(strcmp(a,q1->name)==0){flag[2]=1;q2=q1;q6=q1;}}}//當(dāng)在兩輛車上的起點(diǎn)終點(diǎn)都被找到時(shí),計(jì)算哪輛車上經(jīng)過的站數(shù)較少 //優(yōu)先推薦站數(shù)較少的方法 if(flag[0]==1&&flag[1]==1&&flag[2]==1&&flag[3]==1){i=0;j=0;while(1){i++;if(p1==p3){break;}p1=p1->next;}while(1){j++;if(q1==q3){break;}q1=q1->next;}if(i>j){while(1){printf("%d%s",q2->num,q2->name);if(q2==q3){break;}q1=q1->next;}}else{while(1){printf("%d%s",p2->num,p2->name);if(p2==p3){break;}p1=p1->next;}}}//當(dāng)起點(diǎn)終點(diǎn)都在第一輛車找到時(shí) if((flag[0]==1&&flag[1]==1&&flag[2]==0&&flag[3]==0)||(flag[0]==1&&flag[1]==1&&flag[2]==1&&flag[3]==0)||(flag[0]==1&&flag[1]==1&&flag[2]==0&&flag[3]==1)){while(1){printf("%d.%s->",p2->num,p2->name);if(p2==p3){break;}p2=p2->next;}}//當(dāng)起點(diǎn)終點(diǎn)都在第二輛車找到時(shí) if((flag[0]==1&&flag[1]==0&&flag[2]==1&&flag[3]==1)||(flag[0]==0&&flag[1]==1&&flag[2]==1&&flag[3]==1)||(flag[0]==0&&flag[1]==0&&flag[2]==1&&flag[3]==1)){printf("乘坐%s車\n",head2->name);while(1){printf("%d%s",q2->num,q2->name);if(q2==q3){break;}q2=q2->next;}}//當(dāng)在第一輛公交車找到起點(diǎn),第二輛公交車找到終點(diǎn) if(flag[0]==1&&flag[1]==0&&flag[2]==0&&flag[3]==1){//找兩輛公交車的相同站點(diǎn) while(1){q5=head2; while(1){ //當(dāng)站點(diǎn)名稱相同或q5走到 q4時(shí)跳出內(nèi)層循環(huán) if(strcmp(q5->name,p6->name)==0||q5==q4){printf("1");break;}q5=q5->next;}//當(dāng)站點(diǎn)名稱相同時(shí),跳出外層循環(huán)if(strcmp(q5->name,p6->name)==0)break;p6=p6->next;}//輸出公交1起點(diǎn)到達(dá)轉(zhuǎn)車站的路線 printf("尊敬的乘客朋友\n以下是我們?yōu)槟?guī)劃的路線\n");printf("先乘坐%s\n",head1->name);while(1){printf("%d %s-->",p2->num,p2->name);if(p2==p6)break;p2=p2->next;}printf("\n");//輸出轉(zhuǎn)車站到終點(diǎn)的路線 printf("再乘坐%s\n",head2->name);while(1){printf("%d %s-->",q5->num,q5->name);if(q4==q5){printf("\n");break;}q5=q5->next;}} //起點(diǎn)在二路上,終點(diǎn)在一路車上if(flag[0]==0&&flag[1]==1&&flag[2]==1&&flag[3]==0){//找兩輛公交車的相同站點(diǎn)//p4為在第一輛公交車找到的終點(diǎn)位置 //q6和q2為在第二輛公交車的起點(diǎn)位置 while(1){p4=head1; while(1){ //當(dāng)站點(diǎn)名稱相同或q5走到 q4時(shí)跳出內(nèi)層循環(huán) if(strcmp(q6->name,p4->name)==0||p4==p7){break;}p4=p4->next;}//當(dāng)站點(diǎn)名稱相同時(shí),跳出外層循環(huán)if(strcmp(q6->name,p4->name)==0){ break;} q6=q6->next;}//輸出公交1起點(diǎn)到達(dá)轉(zhuǎn)車站的路線 printf("尊敬的乘客朋友\n以下是我們?yōu)槟?guī)劃的路線\n");printf("先乘坐%s\n",head2->name);while(1){printf("%d %s-->",q2->num,q2->name);if(q2==q6){ break; } q2=q2->next;}printf("\n");//輸出轉(zhuǎn)車站到終點(diǎn)的路線 printf("再乘坐%s\n",head1->name);while(1){printf("%d %s-->",p4->num,p4->name);if(p4==p7){ printf("\n");break;} p4=p4->next;}}/*-------------------------------正序------------------------------------------*//*-------------------------------逆序------------------------------------------*//*-------------------------------逆序------------------------------------------*/} void login() {} int main() {struct bus *head1,*head2;head1=load();int a;while(1){printf("\t\t*************************歡迎光臨公交車管理系統(tǒng)*****************************\n");printf("\t\t* *\n");printf("\t\t* *\n");printf("\t\t* *\n");printf("\t\t* 輸入1管理員登錄 *\n");printf("\t\t* 輸入2乘客查詢 *\n");printf("\t\t* *\n");printf("\t\t* *\n");printf("\t\t* *\n");printf("\t\t****************************************************************************\n");printf("\t\t");scanf("%d",&a);switch(a){case 1:password(head1);break;case 2:find(head1);break;default:printf("請(qǐng)輸入正確的數(shù)字\n");}}} /* 28 102路 1 葛家莊 2 和平路燕子山路 3 燕子山小區(qū) 4 和平路山大路 5 和平路歷山東路 6 和平路山師東路 7 山東新聞大廈 8 大街 9 銀座商城 10 泉城廣場(chǎng) 11 趵突泉南門 12 飲虎池 13 桿石橋 14 經(jīng)七緯二 15 經(jīng)七緯四 16 經(jīng)七路小緯 17 經(jīng)七緯八 18 經(jīng)七緯十二 19 經(jīng)七路振興 20 經(jīng)七路西口 21 南辛莊 22 南辛莊街南 23 試驗(yàn)機(jī)廠 24 王官莊 25 王官莊小區(qū) 26 青龍山小區(qū) 27 后龍 28 濟(jì)南大學(xué) */ /* 25 29路 1 天橋南 2 站前路南口 3 大觀園 4 經(jīng)四緯三 5 山東省眼科醫(yī)院 6 省立醫(yī)院 7 經(jīng)四緯十 8 緯十二路經(jīng) 9 緯十二路經(jīng) 10 經(jīng)十路德興街 11 經(jīng)十路經(jīng)七路 12 南辛莊 13 南辛莊西路 14 試驗(yàn)機(jī)廠 15 王官莊 16 王官莊小區(qū) 17 青龍山長(zhǎng)途客運(yùn)站 18 后龍 19 濟(jì)南大學(xué) 20 七賢廣場(chǎng) 21 七賢莊 22 文莊 23 文莊西 24 石房峪山隧道 25 文賢居 */?
總結(jié)
以上是生活随笔為你收集整理的公交车管理系统C语言的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python md5解密_python写
- 下一篇: 和县机电工程学校工业机器人_【校企合作】