#include <stdio.h> #include <.h> #include <stdlib.h> #include <unistd.h> id[ name[ typedef userName[ userPassword[ main( argc, * system( FILE * file=fopen(, (fread(&aStudent, ( Student), , file)== printf( scanf(,& (land== } (land== printf( printf( printf( scanf( printf( scanf( FILE * ((fp=fopen(, ))== printf( exit( ((fwrite(&userInput, (UserInfo), , fp))!= printf( exit( UserInfo userInput,userBase[ i=,count=,chance= FILE * ((fp=fopen(, ))== printf( exit( (fread(&userBase[i], (UserInfo), , fp)!= i++ count= printf( ( printf( scanf( printf( scanf(,userInput.userPassword); (i=; i<count; i++ ((strcmp(userInput.userName, userBase[i].userName)==)&&(strcmp(userInput.userPassword, userBase[i].userPassword)== (chance!= printf(,- chance++ (chance>= printf( exit( printf( printf( printf( scanf(,& printf( FILE * Student student[ flag= i= k= count= m= ((fp=fopen(, ))== printf( exit( (i=;fread(&student[i], ( Student), , fp)!=;i++ count= printf( i= ( printf( printf(,i+ scanf( (k=i-; k>=; k-- (strcmp(student[i].id, student[k].id)== printf( flag= (k=; k<count; k++ (strcmp(student[i].id, student[k].id)== printf( flag= } flag= printf( scanf( } flag= printf( scanf(,& (student[i].score>||student[i].score< flag= } i++ m++ printf( scanf(,& (ch!=&&ch!= ((fp=fopen(, ))== printf( exit( (i=; i<m; i++ (fwrite(&student[i], ( Student), , fp)!= printf( id[ FILE * printf( printf( scanf( ( ((fp=fopen(,))== printf( (fread(&student, ( Student), , fp)!= (strcmp(id,student.id)== printf( (strcmp(id,student.id)!= printf( printf( scanf( (strcmp(id,)==||strcmp(id,)== FILE * Student student[ i= count= ((fp=fopen(, ))== printf( (i=;fread(&student[i], ( Student), , fp)!=;i++ count= ((fp=fopen(, ))== printf( printf( ( flag= printf( scanf( ( k=; k<count; k++ (strcmp(student[count].id, student[k].id)== printf( flag= } printf( scanf( printf( scanf(,& (fwrite(&student[count], ( Student), , fp)!= printf( printf( printf( scanf(,& (ch!=&&ch!= count++ id[ FILE *infile,* Student students[ i=,flag=-,count= printf( ((infile=fopen(,))== printf( (fread(&students[i], ( Student), , infile)!=) i++ count= printf( scanf( ( (i=; i<count; i++ (strcmp(id,students[i].id)== flag= (flag==- printf( printf( scanf(,& (sure== (i=flag; i<count-; i++ students[i]=students[i+ count-- outfile=fopen(, (i=; i<count; i++ (fwrite(&students[i], ( Student), , outfile)!= printf( printf( printf( scanf( (strcmp(id,)==||strcmp(id,)== unlink(); rename( ,); FILE * id[ score=,count=,flag= i= Student students[ ((fp=fopen(,))== printf( (fread(&students[i], ( Student), , fp)!=) i++ count= printf( ( printf( scanf( (i=;i<count;i++ (strcmp(id,students[i].id)== printf( printf( scanf(,& students[i].score= flag= printf( ((fp=fopen(,))== printf( (i=; i<count; i++ (fwrite(&students[i], ( Student), , fp)!= printf( printf( scanf(,& (ch!=&&ch!= FILE * Student students[ i=,j=,count= ((fp=fopen(,))== printf( (fread(&students[i], ( Student), , fp)!=) i++ count= printf( (i=;i<count-;i++ (j=;j<count--i;j++ (students[j].score<students[j+ temp= students[j]=students[j+ students[j+]= printf(); (i=; i<count; i++ printf( (j=; j<-strlen(students[i].id); j++ printf( printf( (j=; j<-strlen(students[i].name); j++ printf( printf( printf( getchar(); scanf(,& }