//创建一条带头结点的单链表,以0为结尾.
定义结构体
#include <stdio.h> //printf
#include <stdlib.h> //malloc
#include <string.h> //strlen
#define BUF_MAXLEN 1024
typedef int Elemtype; //数据元素的类型
//数据节点
typedef struct node
{
Elemtype data; //数据域:保存数据本身用的
struct node *next; //指针域:用来保存关系用的,保存下一个数据节点的地址
}Node;
typedef struct head
{
Elemtype num;