#include<stdio.h>
#include<stdlib.h>
struct stu_node
{
int num;
char name[12];
int age;
struct stu_node *next;
};
#define LEN sizeof(struct stu_node)
struct stu_node *creat(void)
{
struct stu_node *p1,*p2,*head=NULL;
p1=p2=(struct stu_node *)malloc(LEN);
scanf("%d%d",&p1->num,&p1->age);
getchar();
gets(p1->name);
while(p1->num!=0)
{
if(head==NULL) head=p1;
else
p2->next=p1;
p2=p1;
p1=(struct stu_node *)malloc(LEN);
scanf("%d%d",&p1->num,&p1->age);
getchar();
gets(p1->name);
}
return head;
}
void list(struct stu_node *head)
{
if(head==NULL) printf("kong");
else
{
struct stu_node *p;
p=head;
while(p->num!=0)
{
printf("%d %s %d\n",p->num,p->name,p->age);
p=p->next;
}
}
}
int main()
{
struct stu_node *head;
head=creat();
list(head);
return 0;
}
以上是我自己写的代码
能正常运行 结果也是正确的 但是 总会弹出下面这个窗口
这是什么原因 希望大家帮忙 看一下。
请大家评论下 帮帮忙 支点招。
本文分享了作者自己编写的代码实现学生信息管理功能的过程,并遇到的问题及其解决方法。通过输入学生人数、姓名、年龄等信息创建学生节点,然后进行链式存储并输出学生信息,最终成功解决了代码中出现的窗口弹出问题。
198

被折叠的 条评论
为什么被折叠?



