#include
#include <stdio.h>
using namespace std ;
typedef int DataType;
struct node
{
DataType saleAmount ;//销售数量
struct node *next;//指向下一产品的指针
} ;
typedef struct node * pNode;
//函数功能: 遍历链表并输出链表中各数据元素的值
void traverseList_link(pNode pllist) //功能是输出线性表pllist的元素,以空格为分界符;
{
pNode temp = pllist->next ;
while(temp != NULL)
{
cout<saleAmount <<" " ;
temp = temp->next;
}
}
//创建一个空的链表
pNode createNullList_link(void )
{
struct node* temp = new struct node ;
temp->next = NULL;
temp->saleAmount = 0;
return temp;
}
void insert_link(pNode pllist ,DataType x )
{
pNode temp = new struct node ;
temp->saleAmount = x ;
temp->next = NULL;
pNode p = pllist-