Chinaunix首页 | 论坛 | 博客
  • 博客访问: 474989
  • 博文数量: 93
  • 博客积分: 5006
  • 博客等级: 上校
  • 技术积分: 1002
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-30 13:58
文章分类

全部博文(93)

文章存档

2012年(2)

2011年(68)

2010年(23)

分类: C/C++

2010-05-30 14:08:18

 #include
#include
#include
#include
#include
#define N  sizeof(struct student)
void gate(struct student *p);
void print(struct student *p);
struct student * readd(void);
void writing(struct student *h);
void writmimi(struct mimi *h);
int choice(void);
int jion(struct mimi *p);
struct mimi *readw(void);
void change(struct student *p);
void paixu(struct student *p);
void find(struct student *p);
void pai(struct student *he);
void delet(struct student *p);
void deletcreat(struct student *p);
void coverall(struct student *p);
void tongji(struct student *p,int x);
int  compaire(struct mimi *p,char q[10]);
int zhuce(struct mimi *p);
void genggaimima(struct mimi *p);
struct time
{
    int year;
    int month;
    int day;
};
struct student
{
    char dz[10];
    char zy[10];
    char bj[10];
    char x[10];
    char name[10];
    char sex[10];
    struct time birthday;
    int k1;
    int k2;
    int k3;
    int k4;
    int k5;
    int all;
    struct student *next;
};
struct mimi
{
    char x[10];
    char y[10];
    struct mimi *next;
};
void deletcreat(struct student *p)  /*Á´±íµÄÏú»Ù*/
{
    struct student *a,*r;
    while(p!=NULL)
    {
        a=p;
        r=p->next;
        free(a);
        p=r;
    }
}
void pai(struct student *he)   /*ÅÅÐòµÄº¯Êý*/
{
    struct student *p1,*p2;
    struct student *r,t;
    for(p1=he->next;p1;p1=p1->next)
    {   for(p2=p1->next;p2;p2=p2->next)
    {
        if(strcmp(p1->x,p2->x)>0)
     {
            t=*p1;
            *p1=*p2;
            *p2=t;
            r=p1->next;
            p1->next=p2->next;
            p2->next=r;
     }
    }
    }
}
int compaire(struct mimi *p,char q[10])
{
    int t,i=0;
    char b[10];
    t=0;
    p=p->next;
    while(p!=NULL)
    {
        if(!strcmp(q,p->x))
     {
            printf("ÇëÊäÈëÄãµÄÃÜÂë:");
            flushall();
            b[0]=getch();
            while(b[t]!=13)
         {  
      
            if(b[t]==8&&t>0)
      {
                printf("\b \b");
              t=t-1;
      }
         else
      {
                printf("*");
          t++;
      }
            flushall();
            b[t]=getch();
     }
        b[t]='\0'; 
            if(!strcmp(b,p->y))
      {
          i=1;
                printf("\n½øÈë³É¹¦£¬ÄúÏÖÔÚ¿ÉÒÔ½øÐÐÈçϲÙ×÷\n");
      }
            if(strcmp(b,p->y))
      {
                printf("\nÄúÊäÈëµÄÃÜÂë´íÎó,Äú»¹ÓÐÒ»´Î»ú»áÊäÈë\n");
                printf("ÇëÊäÈëÄãµÄÃÜÂë:");
                flushall();
                b[0]=getch();
                while(b[t]!=13)
          {  
      
                if(b[t]==8&&t>0)
          {
                    printf("\b \b");
               t=t-1;
          }
         else
      {
                printf("*");
          t++;
      }
            flushall();
            b[t]=getch();
     }
        b[t]='\0'; 
                if(!strcmp(b,p->y))
          {
              i=1;
                    printf("\n½øÈë³É¹¦£¬ÄúÏÖÔÚ¿ÉÒÔ½øÐÐÈçϲÙ×÷\n");
          }
                if(strcmp(b,p->y))
          {
                    printf("\nÊäÈë´íÎó!\n");
                    printf("\n»¹ÓÐÒ»´ÎÊäÈë»ú»á!\n");
          }
      }
            break;
     }
        else
            p=p->next;
    }
    return i;
}
void tongji(struct student *p,int x)  /*¶Ô¸÷¿Æ³É¼¨µÄÅÅÐò*/
{
    struct student *p1,*p2,*p3;
    struct student *r,t;
    int i,j=0;
    char a[10];
    int k,di,gao,geshu=0;
    i=x;
    p3=p->next;
    while(p3!=NULL)
    {
        p3->all=(p3->k1+p3->k2+p3->k3+p3->k4+p3->k5);
        p3=p3->next;
        j++;
    }  
    printf("ѧÉú×ÜÊýΪ-%d\n",j);
   
    switch(i)
    {
    case 1: printf("ÇëÑ¡ÔñÄãÊÇÒªÉýÐò(1)ÅÅ»¹ÊǽµÐòÅÅ(0)!\n");
                 scanf("%d",&k);
                 for(p1=p->next;p1;p1=p1->next)
              {  
                     for(p2=p1->next;p2;p2=p2->next)
            {
                if(k)
                { 
                             if(p1->k1>p2->k1)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
                   if(k==0)
                { 
                             if(p1->k1k1)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
                } 
            }
           }
              break;
    case 2: printf("ÇëÑ¡ÔñÄãÊÇÒªÉýÐò(1)ÅÅ»¹ÊǽµÐòÅÅ(0)!\n");
                 scanf("%d",&k);
                 for(p1=p->next;p1;p1=p1->next)
              {  
                     for(p2=p1->next;p2;p2=p2->next)
            {
                if(k)
             {
                             if(p1->k2>p2->k2)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
                   if(k==0)
             {
                             if(p1->k2k2)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
            }
           }
              break;
    case 3: printf("ÇëÑ¡ÔñÄãÊÇÒªÉýÐò(1)ÅÅ»¹ÊǽµÐòÅÅ(0)!\n");
                 scanf("%d",&k);
                 for(p1=p->next;p1;p1=p1->next)
              {  
                     for(p2=p1->next;p2;p2=p2->next)
            {
                if(k)
             {
                             if(p1->k3>p2->k3)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
                   if(k==0)
             {
                             if(p1->k3k3)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
            }
           }
              break;
    case 4: printf("ÇëÑ¡ÔñÄãÊÇÒªÉýÐò(1)ÅÅ»¹ÊǽµÐòÅÅ(0)!\n");
                 scanf("%d",&k);
                 for(p1=p->next;p1;p1=p1->next)
              {  
                     for(p2=p1->next;p2;p2=p2->next)
            {
                if(k)
             {
                             if(p1->k4>p2->k4)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
                   if(k==0)
             {
                             if(p1->k4k4)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
                } 
            }
           }
              break;
    case 5:
        printf("ÇëÑ¡ÔñÄãÊÇÒªÉýÐò(1)ÅÅ»¹ÊǽµÐòÅÅ(0)!\n");
                 scanf("%d",&k);
                 for(p1=p->next;p1;p1=p1->next)
              {  
                     for(p2=p1->next;p2;p2=p2->next)
            {
                if(k)
             {
                             if(p1->k5>p2->k5)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
                   if(k==0)
             {
                             if(p1->k5k5)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
            }
           }
              break;
    case 6:  printf("ÇëÑ¡ÔñÄãÊÇÒªÉýÐò(1)ÅÅ»¹ÊǽµÐòÅÅ(0)!\n");
                 scanf("%d",&k);
                 for(p1=p->next;p1;p1=p1->next)
              {  
                     for(p2=p1->next;p2;p2=p2->next)
            {
                if(k)
             {
                             if(p1->all>p2->all)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
                   if(k==0)
             {
                             if(p1->allall)
                 {
                     t=*p1;
                        *p1=*p2;
                     *p2=t;
                        r=p1->next;
                              p1->next=p2->next;
                        p2->next=r;
                 }
             }
            }
           }
              break;
    case 7:  printf("ÊäÈëÄúÏëÒªÖªµÀµÄ·ÖÊý¶ÎµÄ×îµÍ·Ö:");
        scanf("%d",&di);
        printf("ÊäÈëÄúÏëÖªµÀµÄ·ÖÊý¶ÎµÄ×î¸ß·Ö:");
        scanf("%d",&gao);
        printf("\t\t1-¿ÆÄ¿Ò»\n\t\t2-¿ÆÄ¿¶þ\n\t\t3-¿ÆÄ¿Èý\n");
        printf("\t\t4-¿ÆÄ¿ËÄ\n\t\t5-¿ÆÄ¿Îå\n");
        printf("ÄúÏëÖªµÀÄĿƵijɼ¨·ÖÊý¶Î:");
        scanf("%d",&k);
        switch(k)
     {
        case 1: printf("¿ÆÄ¿Ò»µÄ·ÖÊý%dÓë%dÖ®¼äµÄѧÉúÓÐ:\n",di,gao);
            for(p1=p->next;p1;p1=p1->next)
      {
                if(p1->k1>di&&p1->k1          {
                    printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                 geshu++;
          }
      }
            printf("%d¸ö!",geshu);
            break;
        case 2: printf("¿ÆÄ¿¶þµÄ·ÖÊý%dÓë%dÖ®¼äµÄѧÉúÓÐ:\n",di,gao);
            for(p1=p->next;p1;p1=p1->next)
      {
                if(p1->k2>di&&p1->k2          {
                    printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                 geshu++;
          }
      }
            printf("%d¸ö!",geshu);
            break;
        case 3:printf("¿ÆÄ¿ÈýµÄ·ÖÊý%dÓë%dÖ®¼äµÄѧÉúÓÐ:\n",di,gao);
            for(p1=p->next;p1;p1=p1->next)
      {
                if(p1->k3>di&&p1->k3          {
                    printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                 geshu++;
          }
      }
            printf("%d¸ö!",geshu);
            break;
        case 4:printf("¿ÆÄ¿ËĵķÖÊý%dÓë%dÖ®¼äµÄѧÉúÓÐ:\n",di,gao);
            for(p1=p->next;p1;p1=p1->next)
      {
                if(p1->k4>di&&p1->k4          {
                    printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                 geshu++;
          }
      }
            printf("%d¸ö!",geshu);
            break;
        case 5: printf("¿ÆÄ¿ÎåµÄ·ÖÊý%dÓë%dÖ®¼äµÄѧÉúÓÐ:\n",di,gao);
            for(p1=p->next;p1;p1=p1->next)
      {
                if(p1->k5>di&&p1->k5          {
                printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                 geshu++;
          }
      }
            printf("%d¸ö!",geshu);
            break;
     }
        break;
      case 8: printf("\n¶Ôϵ±ðµÄͳ¼Æ!\n");
                printf("ÇëÊäÈëÄúÏëͳ¼ÆµÄϵ±ð:");
                scanf("%s",a);
                for(p1=p->next;p1;p1=p1->next)
          {
                   if(!strcmp(a,p1->dz))
             {
                       printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                    geshu++;
             }
          }
                printf("¸ÃϵµÄѧÉú×ܹ²ÓÐ%d¸ö\n",geshu);
             break;
      case 9:  printf("\n¶ÔרҵµÄͳ¼Æ\n");
                printf("ÇëÊäÈëÄúÏëͳ¼ÆµÄרҵ:");
                scanf("%s",a);
                for(p1=p->next;p1;p1=p1->next)
          {
                   if(!strcmp(a,p1->zy))
             {
                       printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                  geshu++;
           }
          }
                printf("¸ÃרҵµÄѧÉú×ܹ²ÓÐ%d¸ö\n",geshu);
             break;
      case 10:  printf("\nÇëÊäÈëÄúÏëͳ¼ÆµÄ°à¼¶!\n");
                scanf("%s",a);
                for(p1=p->next;p1;p1=p1->next)
          {
                   if(!strcmp(a,p1->bj))
             {
                       printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                        p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                        p1->birthday.month,p1->birthday.day,
                        p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                    geshu++;
             }
          }
                printf("¸Ã°à¼¶µÄѧÉú×ܹ²ÓÐ%d¸ö\n",geshu);
             break;
        default : printf("ÄúÊäÈëµÄÊý¾ÝÓдí,²»ÊǸóÌÐòÖеÄÖ¸Áî!\n");
            break; 
     }
}
void writing(struct student *h)  /*Êý¾ÝµÄ´æ´¢*/
{
    FILE * fp;
    struct student *p;
    int a=0;
    p=h;
    p=p->next;
    fp=fopen("F:/wang.txt","wt");
    if(fp==NULL)
    {
        printf("\nÎļþ²»´æÔÚ,ÎÞ·¨Ð´Èë\n");
        printf("»ØÖ÷²Ëµ¥ÇëÊäÈëÒ»¸ö!0Êý!");
        scanf("%d",&a);
        if(a)
     {
            choice();
     }
        else
            exit(1);
    }
    while(p!=NULL)
    {
        fprintf(fp,"%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                p->dz,p->zy,p->bj,p->x,p->name,p->sex,p->birthday.year,
                p->birthday.month,p->birthday.day,
                p->k1,p->k2,p->k3,p->k4,p->k5,p->all);
        p=p->next;
    }
    fclose(fp);
}
void writmimi(struct mimi *h)
{
    FILE * fp;
    struct mimi *p;
    int a=0;
    p=h;
    p=p->next;
    fp=fopen("F:/w.txt","wt");
    if(fp==NULL)
    {
        printf("\nÎļþ²»´æÔÚ,ÎÞ·¨Ð´Èë\n");
        printf("»ØÖ÷²Ëµ¥ÇëÊäÈëÒ»¸ö!0Êý!");
        scanf("%d",&a);
        if(a)
     {
            choice();
     }
        else
            exit(1);
    }
    while(p!=NULL)
    {
        fprintf(fp,"%s %s\n",p->x,p->y);
        p=p->next;
    }
    fclose(fp);
}
void coverall(struct student *p)    /*°´·ÖÊýͳ¼Æ*/
{
    struct student *p1;
    int a,i=0;
    int t=0;
    p1=p;
    printf("ÇëÊäÈëÄãÏëÅÅÁеĿÆÄ¿!\n");
    printf("\t\t1-¿ÆÄ¿Ò»\n\t\t2-¿ÆÄ¿¶þ\n\t\t3-¿ÆÄ¿Èý\n");
    printf("\t\t4-¿ÆÄ¿ËÄ\n\t\t5-¿ÆÄ¿Îå\n\t\t6-×ܳɼ¨\n\t\t7-·ÖÊý¶Îͳ¼Æ\n");
    printf("\t\t8-ϵ±ðͳ¼Æ\n\t\t9-רҵͳ¼Æ\n\t\t10-°à¼¶Í³¼Æ\n");
    scanf("%d",&a);
    switch(a)
    {
    case 1:   printf("¿ÆĿһͳ¼Æ!\n");
              tongji(p1,a);
              print(p1);
              if(p1->next->k1<=p1->next->next->k1)
           {
                  printf("¿ÆÄ¿Ò»µÄ³É¼¨%s-×îµÍ!\n",p1->next->name);
                  while(p1->next!=NULL)
            {
                      p1=p1->next;
            }
                  printf("¿ÆÄ¿Ò»µÄ³É¼¨%s-×î¸ß!\n",p1->name);
           }
              else
           {
                  printf("¿ÆÄ¿Ò»µÄ³É¼¨%s-×î¸ß!\n",p1->next->name);
                  while(p1->next!=NULL)
            {
                      p1=p1->next;
            }
                  printf("¿ÆÄ¿Ò»µÄ³É¼¨%s-×îµÍ!\n",p1->name);
           }
              break;
    case 2:  printf("¿ÆÄ¿¶þͳ¼Æ!\n");
        tongji(p1,a);
        print(p1);
     
        if(p1->next->k2<=p1->next->next->k2)
     {
            printf("¿ÆÄ¿¶þµÄ³É¼¨%s-×îµÍ!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿¶þµÄ³É¼¨%s-×î¸ß!\n",p1->name);
     }
        else
     {
            printf("¿ÆÄ¿¶þµÄ³É¼¨%s-×î¸ß!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿¶þµÄ³É¼¨%s-×îµÍ!\n",p1->name);
     }
        break;
    case 3:  printf("¿ÆÄ¿Èýͳ¼Æ!\n");
        tongji(p1,a);
        print(p1);
        if(p1->next->k3<=p1->next->next->k3)
     {
            printf("¿ÆÄ¿ÈýµÄ³É¼¨%s-×îµÍ!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿ÈýµÄ³É¼¨%s-×î¸ß!\n",p1->name);
     }
        else
     {
            printf("¿ÆÄ¿ÈýµÄ³É¼¨%s-×î¸ß!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿ÈýµÄ³É¼¨%s-×îµÍ!\n",p1->name);
     }
        break;
    case 4: printf("¿ÆÄ¿ËÄͳ¼Æ!\n");
        tongji(p1,a);
        print(p1);
        if(p1->next->k4<=p1->next->next->k4)
     {
            printf("¿ÆÄ¿Ëĵijɼ¨%s-×îµÍ!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿Ëĵijɼ¨%s-×î¸ß!\n",p1->name);
     }
        else
     {
            printf("¿ÆÄ¿Ëĵijɼ¨%s-×î¸ß!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿Ëĵijɼ¨%s-×îµÍ!\n",p1->name);
     }
        break;
    case 5: printf("¿ÆÄ¿Îåͳ¼Æ!\n");
        tongji(p1,a);
        print(p1);
        if(p1->next->k5<=p1->next->next->k5)
     {
            printf("¿ÆÄ¿ÎåµÄ³É¼¨%s-×îµÍ!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿ÎåµÄ³É¼¨%s-×î¸ß!\n",p1->name);
     }
        else
     {
            printf("¿ÆÄ¿ÎåµÄ³É¼¨%s-×î¸ß!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("¿ÆÄ¿ÎåµÄ³É¼¨%s-×îµÍ!\n",p1->name);
     }
        break;
    case 6: printf("°´×Ü·Öͳ¼Æ!\n");
        tongji(p1,a);
        print(p1);
        if(p1->next->all<=p1->next->next->all)
     {
            printf("×ܳɼ¨%s-×îµÍ!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("×ܵijɼ¨%s-×î¸ß!\n",p1->name);
     }
        else
     {
            printf("×ܵijɼ¨%s-×î¸ß!\n",p1->next->name);
            while(p1->next!=NULL)
      {
                p1=p1->next;
      }
            printf("×ܵijɼ¨%s-×îµÍ!\n",p1->name);
     }
        break;
    case 7:     tongji(p1,a);
        break;
    case 8:   tongji(p1,a);
             break;
    case 9:  tongji(p1,a); 
            break;
    case 10:  tongji(p1,a);
            break;
    default : printf("ÄúÊäÈëµÄÊý¾ÝÓдí,²»ÊǸóÌÐòÖеÄÖ¸Áî!\n");
        break;
    }
}
void delet(struct student *p)    /*ɾ³ý*/
{
    struct student *p1,*p2;
    int a,i=0;
    char x[10];
    p1=p2=p;
    printf("ÇëÊäÈëÄúÏëɾ³ýµÄѧÉúµÄѧºÅ(1)»òÕßÐÕÃû(2):\n");
    printf("ÇëÊäÈëÄúµÄÑ¡Ôñ:");
    scanf("%d",&a);
    if(a==1)
    { 
        printf("ÇëÊäÈëÄúɾ³ýµÄѧÉúµÄѧºÅ:"); /*°´Ñ§ºÅɾ³ý*/
        scanf("%s",x);
        while(p1->next!=NULL)
     {
            p1=p1->next;
            if(!strcmp(x,p1->x))
      {
                printf("ÕÒµ½!\n");
                p2->next=p1->next; 
                free(p1);
          i++;
             break;
      }
            p2=p2->next;
     }
        if(i==0)
     {
            printf("¸ÃѧºÅµÄѧÉúδÕÒµ½!\n");
     }
        if(i)
     {
            printf("ɾ³ý³É¹¦!\n");
            printf("ÏÖÔڵijÉÔ±ÈçÏÂ!\n");
            print(p);
     }
    }
    if(a==2)
    {
        printf("ÇëÊäÈëÄúɾ³ýµÄѧÉúµÄÐÕÃû:");   /*°´ÐÕÃûɾ³ý*/
        scanf("%s",x);
        while(p1->next!=NULL)
     {
            p1=p1->next;
            if(!strcmp(x,p1->name))
      {
                printf("ÕÒµ½!\n");
                p2->next=p1->next; 
                free(p1);
          i++;
             break;
      }
            p2=p2->next;
     }
        if(i==0)
     {
            printf("¸ÃÐÕÃûµÄѧÉúδÕÒµ½!\n");
     }
        if(i)
     {
            printf("ɾ³ý³É¹¦!\n");
            printf("ÏÖÔڵijÉÔ±ÈçÏÂ!\n");
            print(p);
     }
    }
}
void change(struct student *p)  /*ÐÞ¸Ä*/
{
    FILE *fp;
    int a,i,j=1;
    char x[10];
    struct student *p1;
    fp=fopen("F:/wang.txt","rt+");
    if(fp==NULL)
    {
        printf("\nÎļþ´ò¿ªÊ§°Ü\n");
        printf("»ØÖ÷²Ëµ¥ÇëÊäÈëÒ»¸ö!0Êý!");
        scanf("%d",&a);
        if(a)
     {
            choice();
     }
    }
    printf("ÇëÊäÈëÄúÒª²éÕÒµÄѧÉúµÄѧºÅ»òÕßÐÕÃû:");
    scanf("%s",x);
    p1=p->next;
    while(p1!=NULL)
    {
        if(!strcmp(x,p1->x)||!strcmp(x,p1->name))
     {
            printf("\nÕÒµ½!\n");
         j=0;
            printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                p1->birthday.month,p1->birthday.day,
                p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
            printf("\tÄúÏëÐ޸ĵÄÊÇʲô¾ÍÊäÈë¶ÔÓ¦µÄÊý×Ö!\n");
            printf("\t\t1-ѧºÅ\n\n\t\t2-ÐÕÃû\n\n\t\t3-¿ÆÄ¿Ò»µÄ³É¼¨\n\n");
            printf("\t\t4-¿ÆÄ¿¶þµÄ³É¼¨\n\n\t\t5-¿ÆÄ¿ÈýµÄ³É¼¨\n\n\t\t6-¿ÆÄ¿Ëĵijɼ¨\n\n");
            printf("\t\t7-¿ÆÄ¿ÎåµÄ³É¼¨\n\n\t\t8-ÐÞ¸ÄÉúÈÕ\n\n\t\t9-ÐÞ¸ÄÈ«²¿\n\n");
            printf("\t\tÇëÑ¡Ôñ:");
            scanf("%d",&i);
            switch(i)
      {
            case 1:  printf("ÇëÊäÈëÄúÏë¸ÄΪµÄѧºÅ:");
                scanf("%s",p1->x);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 2:  printf("ÇëÊäÈëÄúÏëÒª¸ÄΪµÄÐÕÃû:");
                scanf("%s",p1->name);
                printf("Ð޸ijɹ¦\n");
                    printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 3:  printf("ÇëÊäÈëÄúÏëÒª¸ÄΪµÄ¿ÆÄ¿Ò»µÄ³É¼¨:");
                scanf("%d",&p1->k1);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 4: printf("ÇëÊäÈëÄúÏëÒª¸ÄΪµÄ¿ÆÄ¿¶þµÄ³É¼¨:");
                scanf("%d",&p1->k2);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 5: printf("ÇëÊäÈëÄúÏëÒª¸ÄΪµÄ¿ÆÄ¿ÈýµÄ³É¼¨:");
                scanf("%d",&p1->k3);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 6:printf("ÇëÊäÈëÄúÏëÒª¸ÄΪµÄ¿ÆÄ¿Ëĵijɼ¨:");
                scanf("%d",&p1->k4);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
                break;
            case 7: printf("ÇëÊäÈëÄúÏëÒª¸ÄΪµÄ¿ÆÄ¿ÎåµÄ³É¼¨:");
                scanf("%d",&p1->k5);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 8: printf("please input year month day:");
                printf("ÊäÈëÄê:");
                scanf("%d",&p1->birthday.year);
                printf("ÊäÈëÔÂ:");
                scanf("%d",&p1->birthday.month);
                printf("ÊäÈëÈÕ:");
                scanf("%d",&p1->birthday.day);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            case 9: printf("ϵ±ð:");
                scanf("%s",p1->dz);
                printf("רҵ:");
                scanf("%s",p1->zy);
                printf("°à¼¶:");
                scanf("%s",p1->bj);
                printf("ѧºÅ:");
                scanf("%s",p1->x);
                printf("ÐÕÃû:");
                scanf("%s",p1->name);
                printf("ÊäÈëÐÔ±ð:");
                scanf("%s",p1->sex);
                printf("ÊäÈëÄê:");
                scanf("%d",&p1->birthday.year);
                printf("ÊäÈëÔÂ:");
                scanf("%d",&p1->birthday.month);
                printf("ÊäÈëÈÕ:");
                scanf("%d",&p1->birthday.day);
                printf("¿ÆÄ¿Ò»³É¼¨:");
                scanf("%d",&p1->k1);
                printf("¿ÆÄ¿¶þ³É¼¨:");
                scanf("%d",&p1->k2);
                printf("¿ÆÄ¿Èý³É¼¨:");
                scanf("%d",&p1->k3);
                printf("¿ÆÄ¿Ëijɼ¨:");
                scanf("%d",&p1->k4);
                printf("¿ÆÄ¿ÎåµÄ³É¼¨:");
                scanf("%d",&p1->k5);
                p1->all=(p1->k1+p1->k2+p1->k3+p1->k4+p1->k5);
                printf("Ð޸ijɹ¦\n");
                printf("%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
             break;
            default : printf("ÄúÊäÈëµÄÊý¾ÝÓдí,²»ÊǸóÌÐòÖеÄÖ¸Áî!");
             break;
     }
    }
    p1=p1->next;
 }
 if(j)
     printf("δÕÒµ½ÄúÏëÕÒµÃѧÉú!\n");
 fclose(fp);
 }
 
 void paixu(struct student *p)  /*ÅÅÐò*/
 {
     struct student *p1;
     p1=p;
     pai(p1);
     print(p1);
 }
 void find(struct student *p)       /* ²éÕÒº¯Êý */
 {
     FILE *fp;
     int w,i=0,a;
     char x[10],m[10],b[3];
     char n,t,y;
     struct student *p1;
     p1=p->next;
     fp=fopen("F:/wang.txt","rt+");
     if(fp==NULL)
     {
         printf("\nÎļþ´ò¿ªÊ§°Ü\n");
         printf("»ØÖ÷²Ëµ¥ÇëÊäÈëÒ»¸ö!0Êý!");
         scanf("%d",&a);
         if(a)
      {
             choice();
      }
     }
     printf("1---ͨ¹ýѧºÅ\n2---ÐÕÃû\n3---Ó¢ÓïÃûµÄÄ£ºý²éÕÒ\n4---ºº×ÖÐÕµÄÄ£ºý²éÕÒ\n");
     scanf("%d",&w);
     switch(w)
     {
     case 1:
         printf("ÇëÊäÈëÄúÒª²éÕÒµÄѧÉúµÄѧºÅ:");
         scanf("%s",x);
         while(p1!=NULL)
      {
             if(!strcmp(x,p1->x))
          {
                 printf("\nÕÒµ½!\n");
                printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
              i++;
          }
             p1=p1->next;
      
      }
         if(i==0)
      {
             printf("ûÓÐÕÒµ½ÄúÏëÕÒµ½µÄѧÉú!\n");
      }
         fclose(fp);
         break;
     
     case 2:  printf("ÇëÊäÈëÄãÏë²éÕÒµÄѧÉúµÄÐÕÃû:");
         scanf("%s",m);
         while( p1!=NULL)
      {
             if(!strcmp(m,p1->name))
          {
                 printf("\nÕÒµ½!\n");
                printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
              i=3;
          }
             p1=p1->next;
      }
         if(i!=3)
             printf("δÕÒµ½!");
         fclose(fp);
         break;
     case 3: printf("ÇëÊäÈëÄúÏë²éÕÒµÄÈ˵ĴóÖÂÐÅÏ¢(Ãû×ֵĵÚÒ»¸ö×Öĸ):");
         flushall();
         scanf("%c",&n);
         while( p1!=NULL)
         { 
    t=p1->name[0];
             if(n==t)
          {
                 printf("\nÕÒµ½!\n");
                 printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
              i=3;
          }
             p1=p1->next;
      }
         if(i!=3)
             printf("δÕÒµ½!");
         fclose(fp); 
         break;
     case 4:
         printf("ÇëÊäÈëÄúÏë²éÕÒµÄÈ˵ĴóÖÂÐÅÏ¢(ºº×ÖÐÕ):");
         scanf("%s",b);
         while( p1!=NULL)
         { 
             t=p1->name[0];
             y=p1->name[1];
             if(b[0]==t&&b[1]==y)
          {
                 printf("\nÕÒµ½!\n");
                printf("%s %s %s %s %s %s %d-%d-%d %d %d %d %d %d %d\n",
                    p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,p1->birthday.year,
                    p1->birthday.month,p1->birthday.day,
                    p1->k1,p1->k2,p1->k3,p1->k4,p1->k5,p1->all);
              i=3;
          }
             p1=p1->next;
      }
         if(i!=3)
             printf("δÕÒµ½!\n");
         fclose(fp); 
         break;
     default : printf("ÄúÊäÈëµÄÊý¾ÝÓдí,²»ÊǸóÌÐòÖеÄÖ¸Áî!");
     }
    
}
struct student *readd(void)  /*Îļþ¶ÁÈëÁ´±í*/
{
    FILE *fp;
    int a;
    struct student *p1,*p2,*he;
    fp=fopen("F:/wang.txt","rt");
    if(fp==NULL)
    {
        printf("\nÎļþ´ò¿ªÊ§°Ü\n");
        printf("»ØÖ÷²Ëµ¥ÇëÊäÈëÒ»¸ö!0Êý!");
        scanf("%d",&a);
        if(a)
     {
            choice();
     }
    }
    while(!feof(fp))
    {
        he=p2=(struct student *)malloc(N);
        p1=(struct student *)malloc(N);
        fscanf(fp,"%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
            p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,&p1->birthday.year,
            &p1->birthday.month,&p1->birthday.day,
            &p1->k1,&p1->k2,&p1->k3,&p1->k4,&p1->k5,&p1->all);
        p2->next=p1;
        p2=p1;
        while(!feof(fp))
     {
            p1=(struct student *)malloc(N);
            fscanf(fp,"%s %s %s %s %s %s %d %d %d %d %d %d %d %d %d\n",
                p1->dz,p1->zy,p1->bj,p1->x,p1->name,p1->sex,&p1->birthday.year,
                &p1->birthday.month,&p1->birthday.day,
                &p1->k1,&p1->k2,&p1->k3,&p1->k4,&p1->k5,&p1->all);
            p2->next=p1;
            p2=p1;
     }
    }
    p2->next=NULL;
    //   print(he);
    fclose(fp);
    return he;
}
struct mimi *readw(void)    /*¶ÁÊý¾Ý*/
{
    FILE *fp;
    int a;
    struct mimi *p1,*p2,*he;
    fp=fopen("F:/w.txt","rt+");
    if(fp==NULL)
    {
        printf("\nÎļþ´ò¿ªÊ§°Ü\n");
        printf("»ØÖ÷²Ëµ¥ÇëÊäÈëÒ»¸ö!0Êý!");
        scanf("%d",&a);
        if(a)
     {
            choice();
     }
        exit(0);
    }
    while(!feof(fp))
    {
        he=p2=(struct mimi *)malloc(N);
        p1=(struct mimi *)malloc(N);
        fscanf(fp,"%s %s\n",p1->x,p1->y);
        p2->next=p1;
        p2=p1;
        while(!feof(fp))
     {
            p1=(struct mimi *)malloc(N);
            fscanf(fp,"%s %s\n",p1->x,p1->y);
            p2->next=p1;
            p2=p1;
     }
    }
    p2->next=NULL;
    return he;
    fclose(fp);
}
int join(struct mimi *p)  /*Óû§ºÍÃÜÂë*/
{
    int  v=0;
    int aer=0;
    int w,i=0;
    char a[10];
    struct mimi *p2,*p3;
    p3=p;
    p2=p->next;
    while(p2!=NULL)
    {
        p2=p2->next;
        i++;
    }
    printf("\n$~$¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡ÁѧÉú³É¼¨¹ÜÀíϵͳ¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á$~$\n");
    printf("\n\t\t      ¸Ãϵͳ¹²ÓÐ%d¸ö¹ÜÀíÔ±!\n",i);
    printf("ÇëÊäÈëÄúµÄÓû§Ãû:");
    scanf("%s",a);
    w=compaire(p3,a);
    if(w==0)
    {
        printf("ÄúÊäÈëµÄÓû§Ãû´íÎó,Äú»¹ÓÐÒ»´Î»ú»áÊäÈë\n");
        printf("ÇëÊäÈëÄúµÄÓû§Ãû:"); 
        scanf("%s",a);   
        w=compaire(p3,a);
    }
    if(w==1)
        v=aer=1;
    if(v==0)
    {
        printf("\n·Ç·¨Óû§!\n");
    }
    return aer;
}
void genggaimi(struct mimi *p)
{
    struct mimi *p1,*p2;
    char a[10],b[10];
    int i,j=0,t=0;
    int u=0,u1=0;
    printf("ÇëÊäÈëÄúµÄÓû§Ãû:");
    scanf("%s",a);
    printf("ÇëÊäÈëÄãµÄÃÜÂë:");
    flushall();
    b[0]=getch();
    while(b[t]!=13)
    {  
    if(b[t]==8&&t>0)
    {
      printf("\b \b");
        t=t-1;
    }
    else
    {
        printf("*");
        t++;
    }
    flushall();
    b[t]=getch();
    }
    b[t]='\0';
    for(p2=p->next;p2;p2=p2->next)
    {
        if(!strcmp(a,p2->x) && !strcmp(b,p2->y))
     {
         j++;
     }
    }
    if(j==0)
            printf("\nÓû§Ãû»òÃÜÂë´íÎó!²»ÄÜÐÞ¸Ä\n");
    if(j)
     {
        printf("\nÄúÏëÐ޸ĵÄÊÇ:\n1-(Óû§Ãû)\n2-(ÃÜÂë)\n3-(Óû§Ãû¼°ÃÜÂë)\n");
        printf("\nÇëÊäÈëÊý×ÖÑ¡Ôñ:");
        scanf("%d",&i);
        switch(i)
     {
        case 1: for(p1=p->next;p1;p1=p1->next)
          {
                    if(!strcmp(a,p1->x)&&!strcmp(b,p1->y))
           {
                     printf("ÇëÊäÈëÄúÏë¸ÄΪµÄÓû§Ãû:");
                     scanf("%s",p1->x);
           }
          }
                printf("\nÐ޸ijɹ¦!\n");
               break;
        case 2: 
             for(p1=p->next;p1;p1=p1->next)
          {
                 if(!strcmp(a,p1->x)&&!strcmp(b,p1->y))
          {
                  printf("ÇëÊäÈëÄúÏë¸ÄΪµÄÃÜÂë:");
                    flushall();
                    b[0]=getch();
                    while(b[u1]!=13)
              {  
                        if(b[u1]==8&&t>0)
            {
                         printf("\b \b");
                   u1=u1-1;
            }
               else
            {
                      printf("*");
                 u1++;
            }
                 flushall();
                    b[u1]=getch();
           }
                 b[u1]='\0';
                    strcpy(p1->y,b);
          }
      }
            printf("\nÐ޸ijɹ¦!\n");
               break;
        case 3:  for(p1=p->next;p1;p1=p1->next)
          {
                    if(!strcmp(a,p1->x)&&!strcmp(b,p1->y))
           {
                    printf("\nÇëÊäÈëÄúÏë¸ÄΪµÄÓû§Ãû:");
                    scanf("%s",p1->x);
                    printf("\nÇëÊäÈëÄúÏë¸ÄΪµÄÃÜÂë(0-9¸öÈÎÒâµÄ×Ö·û»òÊý×Ö):");
                    flushall();
                    b[0]=getch();
                    while(b[u]!=13)
              {  
                        if(b[u]==8&&t>0)
            {
                         printf("\b \b");
                   u=u-1;
            }
               else
            {
                      printf("*");
                 u++;
            }
                     flushall();
                     b[u]=getch();
           }
                 b[u]='\0';
                    strcpy(p1->y,b);
           } 
           }
            printf("\nÐ޸ijɹ¦!\n");
                    break;
        default : printf("\nÄúÊäÈëµÄÊý¾ÝÓдí,²»ÊǸóÌÐòÖеÄÖ¸Áî!\n");
     }
    }
    writmimi(p); 
}
int zhuce(struct mimi *p)  /* ×¢²áÓû§*/
{
    char x;
    int i,w=0,t=0,j=0;
    char a[10],b[10];
    struct mimi *p1,*p2,*p3;
    p2=p;
    i=0;
    printf("\nÐÂÓû§ÇëÀÏÓû§ÎªÄãÉêÇëÓû§Ãû-×ÔÉèÃÜÂë  ÒÔºóƾ´Ë·½¿É½øÈë\n");
    printf("×¢²á--Y:\n");
    flushall();
    scanf("%c",&x);
    if(x=='y'||x=='Y')
    {
        while(p2->next!=NULL)
     {
            p2=p2->next;
     }
        p1=(struct mimi *)malloc(N);
        p1->next=NULL;
        printf("ÇëÉèÖÃÄãµÄÃû×Ö:");
        scanf("%s",p1->x);
        for(p3=p->next;p3;p3=p3->next)
            if(!strcmp(p1->x,p3->x))
      {
                printf("\nÓÐͬÃûµÄÓû§!\n");
          w=1;
      }
        if(w)
     {
            printf("ÇëÖØÐÂÉèÖÃÄãµÄÃû×Ö:");
            scanf("%s",p1->x);
     }
        printf("ÇëÉèÖÃÄãµÄÃÜÂë:");
        printf("ÃÜÂëµÄλÊýΪ1-9¸öÈÎÒâµÄ×Öĸ»òÊý×Ö\n");
        printf("ÇëÊäÈëÄú½«ÏëÉèÖõÄÃÜÂë:\n");
        flushall();
        b[0]=getch();
        while(b[t]!=13)
        {  
          if(b[t]==8&&t>0)
      {
                printf("\b \b");
              t=t-1;
      }
         else
      {
                printf("*");
          t++;
      }
            flushall();
            b[t]=getch();
     }
        b[t]='\0'; 
        printf("\n");
        printf("È·ÈÏÃÜÂë:");
        flushall();
        a[0]=getch();
        while(a[j]!=13)
     {
            printf("*");
            flushall();
         j++;
            a[j]=getch();
     }
        a[j]=0; 
        if(!strcmp(a,b))
        {
            strcpy(p1->y,b);
            p2->next=p1;
         i=1;
     }
        else
            printf("\nÈ·ÈÏÃÜÂë³ö´í!\n");
    }
    return i;
}
int choice(void)       /*Ñ¡ÔñµÄÄ£¿é*/
{
    int choice,c,m,z;
    struct student *head;
    struct mimi * hea;
    char b;
    printf("$~$¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡ÁÏÔʾÖ÷²Ëµ¥¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á$~$\n");
    printf("\t\t0-Í˳öϵͳ\n\n\t\t1 ¼ÈëÊý¾Ý\n\n\t\t2 Êý¾Ý¶Áд\n\n\t\t3 Êý¾ÝÐÞ¸Ä\n\n\t\t4 Êý¾Ýɾ³ý\n\n");
    printf("\t\t5 Êý¾Ý²éѯ\n\n\t\t6 ÅÅÐòºÍͳ¼Æ\n\n");
    printf("\t\t7 ѧºÅÅÅÐòÐÅÏ¢´æ´¢\n\n\t\t8 Óû§×¢²áÓëÓû§¸ü¸ÄÃû»òÃÜÂë\n\n");
    printf("$~$¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡ÁÏÔʾÖ÷²Ëµ¥¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á$~$\n");
    printf("ÇëÊäÈëÄúµÄÑ¡Ôñ!:\n");
    scanf("%d",&choice);
    switch(choice)  
    {
    case 0: system("cls");
             break;
    case 1: printf("ÊäÈëÊý¾ÝÄ£¿é !\n");
        head=readd();
        gate(head);
        printf("ÊÇ·ñ±£´æ(!0±£´æ)\n");
        printf("Ñ¡Ôñ:");
        flushall();
        scanf("%c",&b);
        if(b!='0')
  {
   writing(head);
   printf("\n±£´æ³É¹¦!\n");
  }
        deletcreat(head);
        system("pause");
        system("cls");
        break;
    case 2: printf("Êý¾ÝµÄ¶Áдģ¿é!\n");
        head=readd();
        print(head);
        deletcreat(head);
        system("pause");
        system("cls");
        break;
    case 3: printf("Êý¾ÝµÄÐÞ¸ÄÄ£¿é!\n"); 
        head=readd();
        change(head);
        printf("\nÊÇ·ñ¼ÌÐøÐÞ¸Ä?ÈçÈôÏë¼ÌÐøÐÞ¸ÄÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
        scanf("%d",&c);
        while(c)
     {
            change(head);
            printf("\nÊÇ·ñ¼ÌÐøÐÞ¸Ä?ÈçÈôÏë¼ÌÐøÐÞ¸ÄÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
            scanf("%d",&c);
     }
        writing(head);
        deletcreat(head);
        system("pause");
        system("cls");
        break;
    case 4: printf("Êý¾ÝµÄɾ³ýÄ£¿é!\n");
        head=readd();
        delet(head);
        printf("\nÊÇ·ñ¼ÌÐøɾ³ý?ÈçÈôÏë¼ÌÐøɾ³ýÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
        scanf("%d",&c);
        while(c)
     {
            delet(head);
            printf("\nÊÇ·ñ¼ÌÐøɾ³ý?ÈçÈôÏë¼ÌÐøɾ³ýÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
            scanf("%d",&c);
     }
        writing(head);
        deletcreat(head);
        system("pause");
        system("cls");
        break;
    case 5: printf("Êý¾ÝµÄ²éѯģ¿é!\n");
           head=readd();
           find(head);
           printf("\nÊÇ·ñ¼ÌÐø²éѯ?ÈçÈôÏë¼ÌÐø²éѯÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
           scanf("%d",&c);
           while(c)
           {
               find(head);
               printf("\nÊÇ·ñ¼ÌÐø²éѯ?ÈçÈôÏë¼ÌÐø²éѯÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
               scanf("%d",&c);
           }
           writing(head);
           deletcreat(head);
           system("pause");
           system("cls");
           break;
    case 6: printf("ѧÉú¸÷¿Æ³É¼¨ÅÅÐòºÍ·ÖÊý¶Îͳ¼ÆÄ£¿é!\n");
        head=readd();
        coverall(head);
        printf("\nÊÇ·ñ¼ÌÐøͳ¼Æ?ÈçÈôÏë¼ÌÐø¿´Í³¼Æ½á¹ûÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
        scanf("%d",&c);
        while(c)
     {
            coverall(head);
            printf("\nÊÇ·ñ¼ÌÐøͳ¼Æ?ÈçÈôÏë¼ÌÐø¿´Í³¼Æ½á¹ûÇë°´ÈÎÒâµÄÒ»¸ö·Ç0Êý\n");
            scanf("%d",&c);
     }
        writing(head);
        deletcreat(head);
        system("pause");
        system("cls");
        break;
    case 7: printf("ѧÉúµÄѧºÅÅÅÐò-Êä³ö-´æ´¢Ä£¿é!\n");
        printf("\n¸ÃÄ£¿éÖ»ÊÇÕûÀíѧÉúÐÅÏ¢(¸ù¾ÝѧºÅÅÅÐò)ÔÙÊä³ö!\n");
        head=readd();
        paixu(head);
        writing(head);
        deletcreat(head);
        system("pause");
        system("cls");
        break;
    case 8: printf("Óû§×¢²áÓëÓû§µÄÐÅÏ¢¸ü¸Ä!\n");
        hea=readw();
        printf("\t\t1-×¢²á\n\n\t\t2-Óû§ÐÅÏ¢¸ü¸Ä\n\n");
        printf("ÇëÑ¡Ôñ!\n");
        scanf("%d",&c);
        switch(c)
     {
        case 1:  m=zhuce(hea);
            if(m)
      {
            writmimi(hea);
            printf("\n×¢²á³É¹¦!\n");
      }
        printf("\n¼ÌÐø×¢²á(!0)!\n");
        scanf("%d",&z);
        while(z)
     {
            m=zhuce(hea);
            printf("\n¼ÌÐø×¢²á(!0)!\n");
            scanf("%d",&z);
     }
            break;
        case 2:  genggaimi(hea);   break;
     }
        system("pause");
        system("cls");
        break;
    default : printf("ÄúÊäÈëµÄÊý¾ÝÓдí,²»ÊǸóÌÐòÖеÄÖ¸Áî!");
    }
    return choice;
}
void gate(struct student *p)    /* Êý¾Ý¼Èë×·¼Ó*/
{  
    struct student *p1,*p2,*p3;
    int a=1,t=0;
    p2=p;
    printf("ÇëÊäÈëÄúÏë¼ÓÈëµÄѧÉú:\n");
    while(p2->next!=NULL)
    {
        p2=p2->next;
    }
    while(a!=0)
    { 
        p1=(struct student *)malloc(N);
        p1->next=NULL;
        printf("ϵ±ð:");
        scanf("%s",p1->dz);
        printf("רҵ:");
        scanf("%s",p1->zy);
        printf("°à¼¶:");
        scanf("%s",p1->bj);
        printf("ѧºÅ:");
        scanf("%s",p1->x);
        for(p3=p->next;p3;p3=p3->next)
     {
           if(!strcmp(p1->x,p3->x)) 
           {
            printf("\nѧºÅÖظ´!\n");
            t=1;
           }
     }
        if(t)
     {
            printf("ÖØÊäѧºÅ:");
            scanf("%s",p1->x);
     }
        printf("ÐÕÃû:");
        scanf("%s",p1->name);
        printf("ÐÔ±ð:");
        scanf("%s",p1->sex);
        printf("ÇëÊäÈë³öÉúÄê:");
        scanf("%d",&p1->birthday.year);
        printf("ÇëÊäÈë³öÉúÔÂ:");
        scanf("%d",&p1->birthday.month);
        printf("ÇëÊäÈë³öÉúÈÕ:");
        scanf("%d",&p1->birthday.day);
        printf("\nѧÉú×ܳɼ¨Îª100:\n");
        printf("¿ÆÄ¿Ò»³É¼¨:");
        scanf("%d",&p1->k1);
        printf("¿ÆÄ¿¶þ³É¼¨:");
        scanf("%d",&p1->k2);
        printf("¿ÆÄ¿Èý³É¼¨:");
        scanf("%d",&p1->k3);
        printf("¿ÆÄ¿Ëijɼ¨:");
        scanf("%d",&p1->k4);
        printf("¿ÆÄ¿ÎåµÄ³É¼¨:");
        scanf("%d",&p1->k5);
        p1->all=(p1->k1+p1->k2+p1->k3+p1->k4+p1->k5); 
        p2->next=p1;
        p2=p1;
        printf("ÊÇ·ñÊäÈë((0)·ñ)!:");
        scanf("%d",&a);
    }
    printf("\n¼ÓÈëÐÂѧÉú³É¹¦!\n");
}
void print(struct student *p)/*Êä³öÁ´±í*/
{  
    p=p->next;
    printf("  ϵ±ð\t   רҵ\t       °à¼¶    ѧºÅ\tÐÕÃû\t  ÐÔ±ð\tÉúÈÕ");
    printf("  \t¿ÆÄ¿Ò»  ¿ÆÄ¿¶þ  ¿ÆÄ¿Èý ¿ÆÄ¿ËÄ  ¿ÆÄ¿Îå   ×ܳɼ¨\n");
    while(p!=NULL)
    {
        printf("%8s %8s %8s %8s %8s %8s \t%d-%d-%d%6d%8d%8d%8d%8d%8d\n",
                  p->dz,p->zy,p->bj,p->x,p->name,p->sex,p->birthday.year,
                  p->birthday.month,p->birthday.day,
                  p->k1,p->k2,p->k3,p->k4,p->k5,p->all);
        p=p->next;
    }
}
void main(void)  /*Ö÷º¯Êý*/
{
    int next=1,x;
    struct mimi * hea;
    hea=readw();
    next=join(hea);
    writmimi(hea);
    if(next)
    {
        x=choice();
        while(x!=0)
     {
            x=choice();
     }
    }
    printf("ÒÑÍ˳ö×÷Òµ¹ÜÀíϵͳ--------------½áÊø!\n");
}
 
阅读(1265) | 评论(0) | 转发(0) |
0

上一篇:C++ 继承

下一篇:约瑟夫环的简单实现

给主人留下些什么吧!~~