}
void count()
{
int f=-1;
int num; //所有罚单单数
int j;
int total=0; //某驾驶员的罚单数
char name[20];
char time1[20];
char time2[20];
FILE*fp;
if((fp=fopen("list.txt","r"))==NULL)
{
printf("文件打不开!\n");
printf("\npress enter to return menu\n");
getchar();
menu();
}
for(j=0;!feof(fp);j++) //读取文件
{
fscanf(fp,"%s%s%s%s%s%s",&list[j].vno,&list[j].dname,&list[j].pname,&list[j].pno,&list[j].no,&list[j].date); }
num=j;
fclose(fp);
printf("\n请根据提示输入驾驶员的姓名和一个时间段,统计某个驾驶员在某段时间内的处罚单数目和罚单号\n");
printf("\n\n请输入驾驶员的姓名:");
scanf("%s",name);
printf("\n请输入一个较早的时间:");
scanf("%s",time1);
printf("\n请输入一个最近的时间:");
scanf("%s",time2);
for(j=0;j<num;j++)
{
if((strcmp(list[j].date,time1)>=0)&&(strcmp(list[j].date,time2)<=0))
if((strcmp(list[j].dname,name)==0)&&(strcmp(list[j].dname,name)==0))
{
f=j;
total++;
printf("\n罚单号:%s\n",list[j].no);
}