#include<stdio.h>
typedef
struct students
{
unsigned
number;
char
name[20];
char
sex[6];
unsigned
age;
char
address[50];
struct
{
unsigned
year;
unsigned
month;
unsigned
day;
}birthday;
int
score
;
struct students prior;
struct students next;
}*record;
struct
{ int students=0;
struct students *fnode=NULL;
}hand;
void main()
{
getdell();
putdell();
getch();
}
void
getdell()
{
record last,now;
now=get();
if(!hand.fnode)
{
hand.fnode=now;
hand.fnode.next=NULL;
hand.fnode.prior=NULL;
last=now;
}
last.next=now;
now.next=NULL;
now.prior=last;
last=now;
}
void putdell()
{ record p;
printf("the message");
p=hand.fnode
while(p)
{
printf("the number:%d"p->number);
printf("the name:%s",p->name);
printf("sex:%s",p->sex);
printf("age:%d",p->age);
printf("address:%s",address);
printf("the birthday:%d-%d-%d",p->birthday.year,p->birthday.month,p->birthday.day);
printf("the score");
p->next
}
}
}
struct students get()
{
record
p;
char
str[50];
p=(record)malloc(sizeof(struct students));
if(p)
{ printf("NOT enough
memory");
exit(1);
}
printf("please put the number");
gets(str);
p->number=atoi(str);
printf("put the name");
gets(p->name);
printf("the sex");
gets(p->sex);
printf("put the address");
gets(p->address);
printf("put the birthday:first ,which year:");
gets(str);
p->birthday.year=atoi(str);
printf("put the month");
gets(str);
p-birthday.month;
printf("put the day");
gets(str);
p->birthday.day=atoi(str);
printf("put the score");
gets(str):
p->score=atoi(str) ;
return
(p);
}
大家看哈:还差点;麻烦你们补一下: