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.
26 lines
625 B
26 lines
625 B
void insert()//课程信息录入
|
|
{
|
|
int mai_n();
|
|
FILE *fp;
|
|
struct course c;
|
|
int count;
|
|
int i;
|
|
if((fp=fopen("course.txt","a+"))==NULL)
|
|
{
|
|
printf("cannot open file\n");
|
|
}
|
|
printf("\n 请输入课程门数:\n");
|
|
scanf("%d",&count);
|
|
printf("课程编号 课程名称 课程性质(公共课/必修课) 总学时 授课学时 实验或上机学时 学分 开课学期(年份):\n");
|
|
for(i=0;i<count;i++)
|
|
{
|
|
scanf("%d %s %s %d %d %d %d %d",&c.num,&c.name,&c.kind,&c.time,&c.ttime,&c.etime,&c.mark,&c.term);
|
|
fprintf(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);
|
|
}
|
|
fclose(fp);
|
|
printf("已保存!");
|
|
system("pause");
|
|
system("cls");//清屏
|
|
mai_n();
|
|
}
|