欢迎来到天天文库
浏览记录
ID:30944047
大小:93.50 KB
页数:18页
时间:2019-01-04
《高速公路计费系统》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、高速公路计费系统xTsxTs^JxxTxxTs^7xzjsXTsxTxxv^^Ts^Ts^7xzTx^TxxTs^TsxTx^TxxTxzls^Tx^Ts^7xzls^Tx^Ts^7xzTs>£^^Ts#^S^TS^TSxjs^TS^TS^TSXlXXlXXTXXlX^TS/*taskname:highwaybillingsystem*//*thefilename:vehic.txt*//*name:*//class:*//*schoolnumber:*//*date:2011-06-27*/>lz%lx
2、^lx>lxXT^XTSx
3、xxjs^Jxxpxx
4、sxjsxjx5、SX6、XXTXX7、Sx8、xXTX^JsxTs>lz>lx>lx^TS^TS^TSxjs^TSxpxXTXXTXXTXXTXXTXZT>XT^ineludestdio,h>includestdlib.H>ineludestring.11>ineludeconio.Il>defineN100Structvehicle//vehicleinformotionCharnum[8]・//licenseplatenumberCha9、rsegments[4];//cartypea,b,c(large,medium,small)Charentime[10]・//entrytimeCharenter[2];//enter1,2,3.・・ForeachentryDoublemoney・//cost}vehicle[N]・Intcount二0;TheFILE*fp・//functiondeclarationVoidmenu();//themainmenuVoidinput();//inputfunctionVoidtheshow();//ou10、tputvehicleinformationVoidall();//calculatethetotalnumberofcarsVoidreadfile();//importfromfilesVoidwritefile();//writefileDoublethetotal();//thetotalamountVoidtheprint();//printreportIntmain(){Readfile();While(1){Themenu();}Return0;}Voidreadfile(){Printf(11、“**************************welcometousethehighwaybillingsystem**********"■IPrintf(z/,z);If((fp=fopen(“vehic.txt“,=二NULL)Printf(〃ttnotfoundthetargetfile,thesystemwillcreatethefileforyou!“)//opentheprogram,thesystemfirstcheckstoseeifthereisavehic12、lefile,andifthereisnoautomaticcreationofthefileFp二fopen(“vehic・txt"、〃w+〃);Printf(“tt********************>1^>1^>1^>1^”);Printf(〃tt*f订ehasbeenestablished!*“);Printf(,ztt*pressanykeytoenterthemenu!*”);Printf(“tt********************>1^>1^>1^>113、^#7^#7^#7^”);Getch();Thereturn;}Thefseek(fp,0,2);//thefollowingpartisusedtodetectwhetherthefileisemptyIf(ftell(fp)>0)Thefseek(fp,0,0);Count二0;();Printf(“tt********************>1^>1^>T^14、ortssuccess!*“);Printf(〃tt*pressanykeytoentersystem!*“);Printf(“tt********************>1^>1^>1^>1^>1^>1^>£^>1^>1^>1^>1^>lz>1^>lz>T^
5、SX
6、XXTXX
7、Sx
8、xXTX^JsxTs>lz>lx>lx^TS^TS^TSxjs^TSxpxXTXXTXXTXXTXXTXZT>XT^ineludestdio,h>includestdlib.H>ineludestring.11>ineludeconio.Il>defineN100Structvehicle//vehicleinformotionCharnum[8]・//licenseplatenumberCha
9、rsegments[4];//cartypea,b,c(large,medium,small)Charentime[10]・//entrytimeCharenter[2];//enter1,2,3.・・ForeachentryDoublemoney・//cost}vehicle[N]・Intcount二0;TheFILE*fp・//functiondeclarationVoidmenu();//themainmenuVoidinput();//inputfunctionVoidtheshow();//ou
10、tputvehicleinformationVoidall();//calculatethetotalnumberofcarsVoidreadfile();//importfromfilesVoidwritefile();//writefileDoublethetotal();//thetotalamountVoidtheprint();//printreportIntmain(){Readfile();While(1){Themenu();}Return0;}Voidreadfile(){Printf(
11、“**************************welcometousethehighwaybillingsystem**********"■IPrintf(z/,z);If((fp=fopen(“vehic.txt“,=二NULL)Printf(〃ttnotfoundthetargetfile,thesystemwillcreatethefileforyou!“)//opentheprogram,thesystemfirstcheckstoseeifthereisavehic
12、lefile,andifthereisnoautomaticcreationofthefileFp二fopen(“vehic・txt"、〃w+〃);Printf(“tt********************>1^>1^>1^>1^”);Printf(〃tt*f订ehasbeenestablished!*“);Printf(,ztt*pressanykeytoenterthemenu!*”);Printf(“tt********************>1^>1^>1^>1
13、^#7^#7^#7^”);Getch();Thereturn;}Thefseek(fp,0,2);//thefollowingpartisusedtodetectwhetherthefileisemptyIf(ftell(fp)>0)Thefseek(fp,0,0);Count二0;();Printf(“tt********************>1^>1^>T^14、ortssuccess!*“);Printf(〃tt*pressanykeytoentersystem!*“);Printf(“tt********************>1^>1^>1^>1^>1^>1^>£^>1^>1^>1^>1^>lz>1^>lz>T^
14、ortssuccess!*“);Printf(〃tt*pressanykeytoentersystem!*“);Printf(“tt********************>1^>1^>1^>1^>1^>1^>£^>1^>1^>1^>1^>lz>1^>lz>T^
此文档下载收益归作者所有