You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
586 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

void browser()//课程信息浏览
{
int mai_n();
FILE *fp;
struct course c;
int a;
if((fp=fopen("course.txt","r"))==NULL)
{
printf("\nCannot open course!\n");
}
printf("课程编号 课程名称 课程性质 总学时 授课学时 实验或上机学时 学分开课学期:\n");
for(;!feof(fp);)
{
fscanf(fp,"%d %s %s %d %d %d %d %d\n",&c.num,&c.name,&c.kind,&c.time,&c.ttime,&c.etime,&c.mark,&c.term);
printf("%5d%12s%9s%9d%9d%11d%11d%11d\n",c.num,c.name,c.kind,c.time,c.ttime,c.etime,c.mark,c.term);
}
fclose(fp);
printf("\n1-返回菜单2-退出系统\n");
scanf("%d",&a);system("cls");//清屏
if(a==1)
mai_n();
else
exit(0);
}