void reduce() { int i=0,j,k,id; FILE *fp1,*fp2,*ff; ff=fopen("b.txt","r"); fscanf(ff,"%d",&j); close(ff); if((fp1=fopen("a.txt","r"))==NULL) { printf("file open error"); exit(0); } printf("请输入要删除学生信息的学号\n"); scanf("%d",&id); while(!feof(fp1)) { fscanf(fp1,"%d%d%s%d%d%d%d",&student[i].id,&student[i].class,&student[i].name,&student[i].time_beginhour,&student[i].time_beginminute,&student[i].time_endhour,&student[i].time_endminute); i++; j=i; } fclose(fp1); for(i=0;i<=j;i++) { if(student[i].id==id) k=i; } fp2=fopen("a.txt","w"); if(k==0) { for(i=1;i<=j;i++) fprintf(fp2,"%d%d%s%d%d%d%d",student[i].id,student[i].class,student[i].name,student[i].time_beginhour,student[i].time_beginminute,student[i].time_endhour,student[i].time_endminute); } if(k>0) { for(i=0;i