思考题,有兴趣的可以实现以下,包点评。
给大家留个思考题吧。用C实现一个数据结构,实现对字符串的操作。数据结构的定义自己思考,数据结构上的操作自己思考。
2018-06-21 21:00

2018-06-22 00:48
~

2018-06-22 10:52

程序代码:struct stud *creat(void)
{
struct stud *head,*p1,*p2;
char a; //用来消除%s的缓冲区
n=0;
p2=p1=(struct stud*)malloc(LEN);
printf("输入:");
scanf("%ld%s%c%c%d",&p1->num,p1->name,&a,&p1->sex,&p1->old);
head=NULL;
while(p1->num!=0)
{
n=n+1;
if(n==1)
head=p1;
else
p2->next=p1;
p2=p1;
p1=(struct stud*)malloc(LEN);
printf("Input:");
scanf("%ld%s%c%c%d",&p1->num,p1->name,&a,&p1->sex,&p1->old);
}
p2->next=NULL;
free(p1);
2018-06-22 11:06
2018-06-22 11:10
2018-06-23 08:25
2018-06-23 08:26