You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
3.5 KiB

6 years ago
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
6 years ago
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ѧ<EFBFBD><D1A7>
typedef struct
{
int num; // ѧ<><D1A7>
char name[20]; // <20><><EFBFBD><EFBFBD>
char sex[4]; // <20>Ա<EFBFBD>
int age; // <20><><EFBFBD><EFBFBD>
char birth[20]; // <20><><EFBFBD><EFBFBD>
char home[100]; // סַ
char tel[15]; // <20>
}student;
typedef struct Node
{
student stu;//ѧ<><D1A7><EFBFBD><EFBFBD>Ϣ
struct Node *pnext;//ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ָ<EFBFBD><D6B8>
}node;
node *phead=NULL; //ͷ<>ڵ㣨<DAB5><E3A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
void Inputstudent();
//<2F><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ
void Printstudent();
6 years ago
int main()
6 years ago
{
6 years ago
system("color 2A");
6 years ago
while(1)
{
printf("\t\t\t*****************************************************************\n");
printf("\t\t\t|\t\t<EFBFBD><EFBFBD>ӭʹ<EFBFBD>ú<EFBFBD><EFBFBD>Ϲ<EFBFBD>ҵ<EFBFBD><EFBFBD>ѧѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ\t\t|\n");
printf("\t\t\t*****************************************************************\n");
printf("\t\t\t|\t\t\t<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>\t\t\t\t|\n");
printf("\t\t\t|***************************************************************|\n");
printf("\t\t\t|\t\t\t1.¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t2.<2E><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t3.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t4.<2E><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t5.<2E><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t6.<2E>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t7.ɾ<><C9BE>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ\t\t\t\t|\n");
printf("\t\t\t|\t\t\t0.<2E>˳<EFBFBD>ϵͳ\t\t\t\t|\n");
printf("\t\t\t*****************************************************************\n");
char ch=getch();//<2F>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>
switch(ch)
{
case '1'://¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
6 years ago
Inputstudent();
6 years ago
break;
case '2'://<2F><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ
6 years ago
Printstudent();
6 years ago
break;
case '3'://<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
break;
case '4'://<2F><>ȡѧ<C8A1><D1A7><EFBFBD><EFBFBD>Ϣ
break;
case '5'://<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
break;
case '6'://<2F>޸<EFBFBD>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
break;
case '0'://<2F>˳<EFBFBD>ϵͳ
break;
}
6 years ago
}
return 0;
}
//¼<><C2BC>ѧ<EFBFBD><D1A7><EFBFBD><EFBFBD>Ϣ
void Inputstudent()
{
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>ѧԱ
node *pnewnode=(node*)malloc(sizeof(node));
pnewnode->pnext=NULL;
//Ҫ<><D2AA><EFBFBD>½ڵ<C2BD><DAB5><EFBFBD><EFBFBD><EFBFBD><EBB5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(phead==NULL)
{
6 years ago
6 years ago
phead=pnewnode;
6 years ago
6 years ago
}
else
{
pnewnode->pnext=phead;
phead=pnewnode;
6 years ago
}
6 years ago
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>ѧ<EFBFBD>ţ<EFBFBD>\n");
scanf("%d",&pnewnode->stu.num);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s",pnewnode->stu.name);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s",pnewnode->stu.sex);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%d",&pnewnode->stu.age);
6 years ago
6 years ago
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>\n");
scanf("%s",pnewnode->stu.birth);
6 years ago
6 years ago
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD>סַ<EFBFBD><EFBFBD>\n");
scanf("%s",pnewnode->stu.home);
6 years ago
6 years ago
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s",pnewnode->stu.tel);
6 years ago
6 years ago
printf("¼<EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ɹ<EFBFBD>.\n");
6 years ago
6 years ago
system("pause");
system("cls");
}
//<2F><>ӡѧ<D3A1><D1A7><EFBFBD><EFBFBD>Ϣ
void Printstudent()
{
system("cls");
printf("\t\t*****************************************************************************************\n");
printf("\t\t|\t\t\t<EFBFBD><EFBFBD>ӭʹ<EFBFBD>ú<EFBFBD><EFBFBD>Ϲ<EFBFBD>ҵ<EFBFBD><EFBFBD>ѧѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ\t\t\t\t|\n");
printf("\t\t*****************************************************************************************\n");
printf("\t\t<><D1A7>\t|<7C><><EFBFBD><EFBFBD>\t|<7C>Ա<EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><><EFBFBD><EFBFBD>\t|<7C><>ͥסַ\t\t|<7C><><EFBFBD>˵绰\t\t|\n");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
node *p=phead;
int n=0;
while(p!=NULL)
{
printf("\t\t|---------------------------------------------------------------------------------------|\n");
printf("\t\t|%d\t|%s\t|%s\t|%d\t|%s\t|%s\t\t|%s\t\t|\n",p->stu.num,p->stu.name,p->stu.sex,p->stu.age,p->stu.birth,p->stu.home,p->stu.tel);
6 years ago
6 years ago
p=p->pnext;
n++;
}
printf("\t\t*****************************************************************************************\n");
printf("\t\t<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\t\t\t\n",n);
system("pause");
system("cls");
6 years ago
}
6 years ago