parent
009936c4c0
commit
c6951e13ce
@ -0,0 +1,25 @@
|
|||||||
|
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();
|
||||||
|
}
|
Loading…
Reference in new issue