#include <stdio.h>
#include <math.h>
#include <windows.h>
#define CreatNode(p) p=(SqList*)malloc(sizeof(SqList))//定义创建结点的宏
#define DeleteNode(p) free((void *)p)
typedef struct Date{
double num;
struct Date *next;
}SqList;
//创建链表
void creat(int count,SqList *h) {
SqList *p, *r;
int i;
r=h;
for (i = 0; i <count; i++)//n+1 次
{
CreatNode(p);
scanf_s("%lf",&p->num );
r->next = p;
r = p;
}
r->next = NULL;
}
//释放链表
void freelist(SqList * head) {
SqList *p, *next;
for (p = head->next; p != NULL; p=next) //n+1 次
{
next = p->next;
DeleteNode(p);
}
head = NULL;
}
//输出链表
void output(SqList *head)
{
SqList *p;
p = head->next;
while (p)