#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include<string.h>
int a,b,c,d,i,j;
struct node
{
int num;
};
struct node *f[22];
void exit0()
{
FILE *fp;
int k;
alp:if((fp=fopen("sore.txt","w"))==NULL)
{
printf("创建文件失败\n");
printf(" 1*****重试\n");
printf(" 2*****强制退出(数据将不会保存到文件)\n");
printf(" 3*****回到主菜单\n");
alj: scanf("%d",&k);
if(k==1)
goto alp;
else if(k==2)
exit(0);
else if(k==3)
return;
else
{
printf("输入错误,请重新输入:");
goto alj;
}
}
fprintf(fp,"\n\n");
fprintf(fp,"运动会分数统计表\n\n\n");
fprintf(fp,"项目代号");
for(i=1;i<=c+d;i++)
fprintf(fp,"%5d",i);
fprintf(fp," ");
fprintf(fp,"\n 学校代号\n");
for(i=1;i<=a;i++)
{
fprintf(fp,"%10d",i);
for(b=1;b<=c+d;b++)
{
fprintf(fp,"%5d",f[i][b].num);
}
fprintf(fp,"\n");
}
fprintf(fp,"\n\n");
fprintf(fp," 注:本次运动会有%d个学校参赛\n\n",a);
fprintf(fp," 其中1 ~ %d组是男子组,%d ~ %d组是女子组\n",c,c+1,c+d);
printf("\n比赛成绩已保存到当前路径下的sore.txt文件中\n\n");
fclose(fp);
exit(1);
}
int choose()
{
int choo;
printf("\n\n 1*输入成绩\n");