|
|
|
|
#include"ˢ<>º<EFBFBD><C2BA><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2>Һ<EFBFBD><D2BA><EFBFBD>.c"
|
|
|
|
|
void sort()/*<2A><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
{
|
|
|
|
|
int i,j,s;
|
|
|
|
|
char temp[10];
|
|
|
|
|
for(i=0;i<n-1;i++)
|
|
|
|
|
{
|
|
|
|
|
for(j=n-1;j>i;j--)
|
|
|
|
|
if(strcmp(stu[j-1].id,stu[j].id)>0)
|
|
|
|
|
{
|
|
|
|
|
strcpy(temp,stu[j-1].id);
|
|
|
|
|
strcpy(stu[j-1].id,stu[j].id);
|
|
|
|
|
strcpy(stu[j].id,temp);
|
|
|
|
|
strcpy(temp,stu[j-1].name);
|
|
|
|
|
strcpy(stu[j-1].name,stu[j].name);
|
|
|
|
|
strcpy(stu[j].name,temp);
|
|
|
|
|
strcpy(temp,stu[j-1].sex);
|
|
|
|
|
strcpy(stu[j-1].sex,stu[j].sex);
|
|
|
|
|
strcpy(stu[j].sex,temp);
|
|
|
|
|
strcpy(temp,stu[j-1].birth);
|
|
|
|
|
strcpy(stu[j-1].birth,stu[j].birth);
|
|
|
|
|
strcpy(stu[j].birth,temp);
|
|
|
|
|
strcpy(temp,stu[j-1].add);
|
|
|
|
|
strcpy(stu[j-1].add,stu[j].add);
|
|
|
|
|
strcpy(stu[j].add,temp);
|
|
|
|
|
strcpy(temp,stu[j-1].tel);
|
|
|
|
|
strcpy(stu[j-1].tel,stu[j].tel);
|
|
|
|
|
strcpy(stu[j].tel,temp);
|
|
|
|
|
strcpy(temp,stu[j-1].email);
|
|
|
|
|
strcpy(stu[j-1].email,stu[j].email);
|
|
|
|
|
strcpy(stu[j].email,temp);
|
|
|
|
|
s=stu[j-1].age;
|
|
|
|
|
stu[j-1].age=stu[j].age;
|
|
|
|
|
stu[j].age=s;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void add() /*<2A><><EFBFBD>뺯<EFBFBD><EBBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>*/
|
|
|
|
|
{
|
|
|
|
|
int i=n,j,flag;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n");
|
|
|
|
|
scanf("%d",&m);
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
flag=1;
|
|
|
|
|
while(flag)
|
|
|
|
|
{
|
|
|
|
|
flag=0;
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>:\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].id);
|
|
|
|
|
for(j=0;j<i;j++)
|
|
|
|
|
if(strcmp(stu[i].id,stu[j].id)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ѧ<EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!\n");
|
|
|
|
|
flag=1;
|
|
|
|
|
break; /*<2A><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>ò<EFBFBD>ѭ<EFBFBD><D1AD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ٶ<EFBFBD>*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].name);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n",i+1);
|
|
|
|
|
scanf("%d",&stu[i].age);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>:\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].sex);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:(<28><>ʽ:<3A><>.<2E><>)\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].birth);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD>ĵ<EFBFBD>ַ:\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].add);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD>ĵ绰:\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].tel);
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>E-mail:\n",i+1);
|
|
|
|
|
scanf("%s",stu[i].email);
|
|
|
|
|
if(flag==0)
|
|
|
|
|
{
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while(i<n+m);
|
|
|
|
|
n+=m;
|
|
|
|
|
printf("¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\n\n");
|
|
|
|
|
sort();
|
|
|
|
|
}
|