struct node
{
int data;
node *next;
};
node *creatlist(int n);
int main(int argc, char *argv[])
{
int n;
node *listhead=null;
cout<<"jiedianshu"<<endl;
cin>>n;
if (n>0)
headlist=creatlist(n);
return 0;
}
node *creatlist(int n)
{
node *head=,*temp,*tail=null;
int num;
cin>>num;
head=new node;
if (head==null)
return null;
else
{
head->data=num;
head->next=null;
tail=head;
}
}
for (int i=0;i<n-1;i++)
{
cin>>num;
temp=new node;
if (temp==null)
return head;
else
{ temp->data=num;
temp->next=null;
tail->next=temp;
tail=temp;
}
}
return head;