w=(struct student *)malloc(sizeof(struct student));
p=head->next;
u=w->next;
while(p!=NULL) //把第一条链表中属于时间范围内的节点数据放进第三条链表
{ printf("a");
if((p->yue<zhongyue&&p->yue>qiyue)||(qiyue==zhongyue&&p->ri<=zhongri&&p->ri>=qiri)||(p->yue==qiyue&&p->ri>=qiri&&qiyue!=zhongyue)||(p->yue==zhongyue&&qiyue!=zhongyue&&p->ri<=zhongri))//判断是否在指点时间范围内
{
z=(struct student *)malloc(sizeof(struct student));printf("b");
strcpy(z->name,p->name);printf("c");
strcpy(z->class_name,p->class_name);printf("d");
strcpy(z->type,p->type);printf("e");
z->yue=p->yue;printf("f");
z->ke=p->ke;printf("g");
z->ri=p->ri;printf("h");
u->next=z;printf("i");
u=z;printf("j");
}
p=p->next;
}
这段代码是为了把一条链表里符合if语句里面条件的数据放到另一条链表里去
然后程序运行到输出i前面就停了,还没有报错
求解答