/*程序开始*/
#include<stdio.h>
#define A 100
int y=0,f=0,j,W,M,N,p[15],q[15];               /*定义全局变量,例N个参赛院系总数,M个男子竞赛项目,W个女子竞赛项目*/
struct student                                              /*运用结构体                                       */
{ char school[20];                                          /*学校名称                                         */ 
  char name[20];                                            /*学生姓名                                         */   
  char item[20];                                            /*参加项目名称                                     */
  char sex;                                                 /*性别                                             */             

   
  int position;                                             /*名次                                             */
  int mark;                                                 /*学生总分                                          */        
}stu[A];                                                    /*变量学生列表                                      */

  struct item                                                /*运用结构体                                        */
{ char name[20];                                            /*项目名称                                          */
  char sex;                                                 /*项目的类别                                        */
  int mark;                                                 /*项目的分数                                        */ 
}it[A];

struct shool                                                /*运用结构体                                        */
{ char name[20];                                            /*名称                                          */   
  char item[20];                                            /*项目*/
  int mark;                                                 /*总分*/  
}scho[A];                                                   /*变量学校列表*/

main()                                                      /*主函数*/                       
{
 menu();                                                    /*调用菜单程序*/     
}

menu()                                                      /*菜单程序*/
{ int w1,n;
  do                                                        /*运用do-while循环结构*/
   { puts("\t\t*****************MENU********************");  /*输出菜单*/
     puts("\n\n\t\t   1.The information to writein\n");
     puts("\t\t   2.The race result records to writein\n");
     puts("\t\t   3.Search the information\n");
     puts("\t\t   4.Exit\n");
     puts("\n\t\t*****************************************");
     puts("\n\nChoice you number:");                          /*选择序号1--4*/
     scanf("%d",&n);
     if(n<1||n>4){w1=1;getchar();}                            /*运用if-else条件语句*/                        
     else w1=0;
    }while(w1==1);
  switch(n)                                                   /*运用switch多分支结构*/
  { case 1:establish();break;                                 /*   */
    case 2:enter();break;                                                     /**/
{
    case 3:search();break;                                                    /**/
    case 4:exit(0);                                                           /*退出程序*/
  }
}

establish()
{ int h,r; 
  extern N,M,W;                                     /*引用声明*/
    y=1;
 printf("\nThe number of shool attended is:");                              /*输出参加学校个数*/
 scanf("%d",&N);
 printf("\nThe number of men item is:");                                     /*输出男子项目个数*/
 scanf("%d",&M);
 printf("\nThe number of women item is:");                                   /*输出女子项目个数*/
 scanf("%d",&W);
 printf("\nThere are three form of marked you can choice:");                 /*选择序号*/
 printf("\n\n\t1).1th--7,2th--5,3th--3,4th--2,5th--1.");
 printf("\n\n\t2).1th--5,2th--3,3th--1.");
 printf("\n\n\t3).Define by youself.");
loop: printf("\n\nChoice the number(1--3):");                                /*输出序号*/  
 scanf("%d",&h);
 if(h>0&&h<4)                                                                /*运用if-else语句*/
   switch(h)
    {case 1:j=1;break;
     case 2:j=2;break;
     case 3:define_mark();
    }
  else goto loop;                                                           /*没有输入1--3序号,继续输入*/
  printf("Success!!!\nPress any key+Enter to menu..");scanf("%d",&r);
  menu();
}

enter()                                                                     /*选择菜单序号2的程序*/
{ int t,r,i=0;extern j,y;char F,M;                
 if(y==0)                                                                   /*运用if-else语句*/
  { printf("Please establish system first!!\nPress any key+Enter to menu.. ");
    scanf("%d",&r);
    menu();
  }
do
 {
  
}