#include <iostream>
#include <stdlib.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef struct LNode
{
int data;
struct LNode *next;
}LNode;
LNode* createLinkList() //创建的链表
{
LNode *head;
head=(LNode*)malloc(sizeof(LNode));
head->next=NULL;
int num;
cout<<"请问元素个数是:\n";
cin>>num;
cout<<"请输入您的元素:\n";
for(int i=0;i<num;i++) //tou插法插入链表
{
LNode *p=(LNode*)malloc(sizeof(LNode));
p->next=head->next;
head->next=p;
cin>>p->data ;
}
return head;
}
LNode* getMax(LNode *head)
{
LN