交通处罚单系统课程设计报告(编辑修改稿)内容摘要:

if((fp1=fopen(,r))==NULL) { printf(can not open file\n)。 printf(\npress enter to return menu\n)。 getchar()。 getchar()。 menu()。 } for(j=0。 !feof(fp1)。 j++) //读取文件 { fscanf(fp1,%s%s%s%s%s%s,amp。 list[j].vno,amp。 list[j].dname,amp。 list[j].pname,amp。 list[j].pno,amp。 list[j].no,amp。 list[j].date)。 } num=j。 fclose(fp1)。 printf(请输入要删除的处罚单的编号 \n)。 scanf(%s,s1)。 for(j=0。 jnum。 j++) { if(strcmp(s1,list[j].no)==0) { f=j。 if(fnum) { for(j=f。 jnum。 j++) { strcpy(list[j].vno,list[j+1].vno)。 strcpy(list[j].dname,list[j+1].dname)。 strcpy(list[j].pname,list[j+1].pname)。 strcpy(list[j].pno,list[j+1].pno)。 strcpy(list[j].no,list[j+1].no)。 strcpy(list[j].date,list[j+1].date)。 } } if((fp2=fopen(,w))==NULL) { printf(文件打不开。 \n)。 printf(\npress enter to return menu\n)。 getchar()。 menu()。 } for(j=0。 jnum。 j++) //保存文件 { fprintf(fp2,\n%s\n%s\n%s\n%s\n%s\n%s,list[j].vno,list[j].dname,list[j].pname,list[j].pno,list[j].no,list[j].date)。 } fclose(fp2)。 printf(\n 删除成功。 \n)。 printf(\npress enter to return menu\n)。 getchar()。 getchar()。 menu()。 } } if(f0) { printf(\n 没有找到该学号的记录 :\n)。 printf(\npress enter to return menu\n)。 getchar()。 getchar()。 menu()。 } } void browse() { int j。 int num。 FILE*fp。 if((fp=fopen(,r))==NULL) { printf(can not open file\n)。 printf(\npress enter to return menu\n)。 getchar()。 getchar()。 menu()。 } for(j=0。 !feof(fp)。 j++) //读取文件 { fscanf(fp,%s%s%s%s%s%s,amp。 list[j].vno,amp。 list[j].dname,amp。 list[j].pname,amp。 list[j].pno,amp。 list[j].no,amp。 list[j].date)。 } fclose(fp)。 num=j。 printf(\n 已添加 %d 条记录 \n\n,num)。 for(j=0。 jnum。 j++) //输出 { printf(第 %d 条记录为 :\n,j)。 printf( : %s\n,list[j].vno)。 printf( : %s\n,list[j].dname)。 printf( : %s\n,list[j].pname)。 printf( : %s\n,list[j].pno)。 printf( : %s\n,list[j].no)。 printf( : %s\n,list[j].date)。 printf(\n)。 } printf(\npress enter to return menu\n)。 getchar()。 getchar()。 menu()。 } void search() { int n。 int r。 do { system(cls)。 printf(\n 请选择查询类型 :\n\t1按车牌号 2按 驾驶员姓名 3:按开单交警姓名 4返回主菜单 \n)。 printf(\n 请输入数字选择 :)。 scanf(%d,amp。 n)。 if(n1||n4) { r=1。 getchar()。 } else r=0。 }while(r==1)。 switch(n) { case 1:vno_search()。 break。 case 2:dna_search()。 break。 case 3:pna_search()。 break。 case 4:menu()。 } } void vno_search() { int f=1。 int num。 int j。 char no[20]。 FILE*fp。 if((fp=fopen(,r))==NULL) { printf(文件打不开。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。