diff --git a/README.md b/README.md index d3ee4af..226cfee 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,25 @@ void PrintScore(STU stu[],int n,int m) ``` void WritetoFile(STU stu[],int n,int m) { + FILE *fp; + int i, j; + if((fp = fopen("student.txt","w")) == NULL) + { + printf("Failure to open score.txt!\n"); + exit(0); + } + fprintf(fp, "%d\t%d\n", n, m); //将学生人数和课程门数写入文件 + for (i=0; i