13187261606 6 years ago
parent 97c9adba4c
commit e504bd6981

@ -64,7 +64,7 @@ struct student* Create()
pNew->next=NULL; pNew->next=NULL;
pEnd->next=pNew; pEnd->next=pNew;
pEnd=pNew; pEnd=pNew;
printf("\t\t\t是否继续录入y/任意):"); printf("\t\t\t是否继续录入y/任意):\n");
key = getch(); key = getch();
} }
struct student *pTemp; struct student *pTemp;
@ -164,7 +164,7 @@ struct student* Delete()
} }
pNow->next=NULL; pNow->next=NULL;
pre=pTemp=phead; pre=pTemp=phead;
printf("请输入学号:"); printf("\t\t\t请输入学号:");
renew: scanf("%s",s); renew: scanf("%s",s);
while(strcmp(pTemp->id,s)) while(strcmp(pTemp->id,s))
{ {
@ -172,8 +172,8 @@ struct student* Delete()
pTemp=pTemp->next; pTemp=pTemp->next;
if(pTemp==NULL) if(pTemp==NULL)
{ {
printf("学号输入有误!!!"); printf("\t\t\t学号输入有误!!!");
printf("请重新输入:"); printf("\t\t\t请重新输入:");
goto renew; goto renew;
} }
} }
@ -237,6 +237,7 @@ void search()
int x; char s[20]; int x; char s[20];
printf("\t\t\t请选择查询方式\n1.学号查询\n2.姓名查询\n3.性别查询\n4.年龄查询\n"); printf("\t\t\t请选择查询方式\n1.学号查询\n2.姓名查询\n3.性别查询\n4.年龄查询\n");
RE: scanf("%d",&x); RE: scanf("%d",&x);
fflush(stdin); //清空缓冲区
pTemp=phead; int Y=0; pTemp=phead; int Y=0;
switch(x) switch(x)
{ {
@ -343,7 +344,7 @@ struct student* Change()
pNow->next=NULL; pNow->next=NULL;
pTemp=phead; pTemp=phead;
char s[20]; char s[20];
printf("请输入要修改学生的学号:"); printf("\t\t\t请输入要修改学生的学号:");
scanf("%s",s); scanf("%s",s);
while(pTemp!=NULL) while(pTemp!=NULL)
{ {
@ -366,6 +367,7 @@ struct student* Change()
int main() int main()
{ {
system("mode con cols=80 lines=30");
system("color F5"); system("color F5");
char x=0; char x=0;
char m[7]; char m[7];
@ -420,7 +422,7 @@ int main()
} }
else else
{ {
printf("密码错误,请重试!!!\n"); printf("\t\t\t密码错误,请重试!!!\n");
goto Re; goto Re;
} }

Binary file not shown.
Loading…
Cancel
Save