全文预览

火车票务管理系统C语言

上传者:火锅鸡 |  格式:doc  |  页数:20 |  大小:141KB

文档介绍
+;?}printf("continue(Y/N)(Ntoend)?");?getchar();?scanf("%c",&ch);?}while(ch!='N');?printf("\n");?fclose(fp1);}voidSearchToPlace(){?FILE*fp2;?charnum[20];?charch;?inti=0;?fp2=fopen(".\\train.rec","r+");if(!fp2)?{ printf("Filecannotbeopened\n"); exit(1);?}do?{?rewind(fp2);?printf("输入你要查询的终点.\n>>>");?scanf("%s",num);?while(!feof(fp2))?{ fread(&train[i],sizeof(structTRAIN),1,fp2); if(strcmp(num,train[i].toPlace)==0) { printf("%-4s%-12s%-8s%-10s%-10s%-8s%.2lf",train[i].trainNum,train[i].date,train[i].fromPlace,train[i].toPlace, train[i].inTime,train[i].outTime,train[i].price); printf("\n"); } i++;?}printf("continue(Y/N)(Ntoend)?");?getchar();?scanf("%c",&ch);?}while(ch!='N');?printf("\n");?fclose(fp2);}voidSearchFromPlace(){?FILE*fp3;?charnum[20];?charch;?inti=0;?fp3=fopen(".\\train.rec","r+");

收藏

分享

举报
下载此文档