",str3[]="c_language",str4[]="english",str5[]="practise";printf("请输入您的教师号\n");scanf("%s",tnum);fp=fopen("teacher.txt","r");for(i=0;fread(&teacher[i],sizeof(structteacher),1,fp)!=0;i++)?{?if(strcmp(tnum,teacher[i].tnum)==0)n=i;?}?if(strcmp(teacher[n].course,str1)==0) { do{ fp1=fopen("student.txt","r"); fp2=fopen("grade.txt","a+"); printf("请输入您所要添加学生的学号\n"); scanf("%s",snum); j=0; for(i=0;fread(&student[i],sizeof(structstudent),1,fp1)!=0;i++) { if(strcmp(snum,student[i].snum)==0) strcpy(grade[j].num,student[i].snum); } printf("请输入高等数学的成绩\n"); scanf("%f",&grade[j].math); fwrite(&grade[j],sizeof(structgrade),1,fp2);j++; fclose(fp1); fclose(fp2); printf("是否继续添加,是1,否0\n"); scanf("%d",&k); }while(k==1); } elseif(strcmp(teacher[n].course,str4)==0) { 继续添加其他课程elseprintf("不存在这门课,请核实\n"); fclose(fp);}