#include "stdio.h"
#include "string.h"
struct student
{
int no;//学号
char name[10];//年龄
char sex[10];//性别,男:M(male),女:F(female)
int age;//年龄
struct student *next;
};
void main()
{
struct student a,b,c,*head,*p;
int year;//输入一个年龄
a.no=30156;strcpy(a.name,"zhao");strcpy(a.sex,"M");a.age=21;
b.no=30158;strcpy(b.name,"qian");strcpy(b.sex,"F");b.age=19;
c.no=30160;strcpy(c.name,"sun");strcpy(c.sex,"M");c.age=20;
head=&a;
#include "string.h"
struct student
{
int no;//学号
char name[10];//年龄
char sex[10];//性别,男:M(male),女:F(female)
int age;//年龄
struct student *next;
};
void main()
{
struct student a,b,c,*head,*p;
int year;//输入一个年龄
a.no=30156;strcpy(a.name,"zhao");strcpy(a.sex,"M");a.age=21;
b.no=30158;strcpy(b.name,"qian");strcpy(b.sex,"F");b.age=19;
c.no=30160;strcpy(c.name,"sun");strcpy(c.sex,"M");c.age=20;
head=&a;

这篇博客讨论了如何建立一个链表,每个节点包含学号、姓名、性别和年龄。内容涉及根据输入的年龄删除链表中对应年龄的节点,不过并未考虑删除表头或表尾节点的情况。
最低0.47元/天 解锁文章
5440

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



