#include #include #include #include #include #define n 2 #define m 1 #define w 1 #define null 0 struct itemnode{ int itemnum; int top; int range[5]; int mark[5]; char name[8]; }; struct headnode{ int schoolnum; int score; int mscore; int wscore; itemnode c[m+w]; }; headnode h[n]; void inputinformation() { int i,j,k,s; char ch; for(i=0;in) printf("错误:这个学校没有参加此次运动会!"); else { printf("所要查询的参赛项目编号:"); scanf("%d",&j); if(j>m+w||j==0) printf("此次运动会没有这个项目\n\n"); else { printf("\n这个项目取前%d名,该学校的成绩如下:\n",h[0].c[j-1].top); for(k=0;k<5;k++) if(h[i-1].c[j-1].range[k]!=0) { printf("所获得的名次:%d\n",h[i-1].c[j-1].range[k]); } } } printf("\n"); printf("请选择 2 继续 , 0 跳出\n"); scanf("%d",&s); printf("\n\n"); }while(s==2); } void writedata() { FILE *report; int i; if((report=fopen("sportsdata.txt","w"))==null) { printf("不能打开文件\n"); exit(1); } for(i=0;i