1、#include#include#include#include#define SIZE 9#define N 3 #define WM 3void bsxm(); /比赛项目void csxx(); /参赛学校void ttzf(); /团体总分void Information();void main();void menu();void printf_back();void saveathlete();void saveprogram();void saveschool();void savescore();void Search();int i;FILE *fp1,*fp2,*fp3,*
2、fp4;struct athlete /定义运动员信息char univ5;char name8;char prog15;char mingci5;int score;atSIZE;struct xuexiao /定义学校信息char univ5;char prog15;int num_athlete;xxN;struct program /定义项目信息char prog5;int quming;char ath15;char ath25;char univ15;char univ25;proWM;struct zongfen /定义学校得分信息char univ5;char prog15;c
3、har prog25;char prog35;int score1;int score2;int score3;int total_score;zfN;void Information()/进入信息录入系统选择系统子函数int n,w ;do puts(“nnn“);puts(“tt*_ Welcome to load 信息录入 system! _*n“);puts(“tt*MENU*n“);puts(“tt* 1.saveathlete *n“);/运动员姓名录入puts(“tt* 2.saveschool *n“);/运动员学校录入puts(“tt* 3.saveprogram() *n“
4、);/参加项目录入puts(“tt* 4.back *n“);/退出puts(“tt*n“);printf(“Choic your number(1-4): bb“);scanf(“%d“,if (n4)w=1;printf(“nntt-DATAERROR!-nnn“);getchar();else w=0;while (w=1);switch(n)case 1 : saveathlete(); break;/ 保存运动员信息子函数case 2 : saveschool(); break;/保存学校信息子函数case 3 : saveprogram();break;/保存项目比赛信息子函数ca
5、se 4 : exit(0);void saveathlete() /保存运动员信息子函数printf(“n 请输入各项目获奖运动员的信息: “);for(i=0;i4)w2=1;printf(“nntt-DATAERROR!-nnn“);getchar();else w2=0;while (w2=1);switch(n)case 1: ttzf();break;case 2: csxx();break;case 3: bsxm();break;case 4: exit(0);break;default: printf(“未进行任何操作!“);void ttzf() /查看学校团体总分子函数f
6、p2=fopen(“zfen“,“r“);printf(“n 各学校的团体总分情况如下: nn“);printf(“学校 参赛项目 总分n“);for(i=0;i4)w1=1;printf(“nntt-DATAERROR!-nnn“);getchar();else w1=0;while (w1=1);switch(n)case 1:Information();break; /输入信息case 2:savescore();break;/比赛结果录入case 3:Search();break;/查询模块case 4:exit(0);/公共函数void printf_back()int w;printf(“nntSUCCESSFUL!nn“);printf(“What do you want to do next?nnt1).exit t2).menu: bb“);scanf(“%d“,if(w=1)exit(0);else menu();