#include<iostream.h>
struct node
{
    int music[10];
    char name[10];
    int i;
    node *next;
};
class LinkList
{
public:
    LinkList()
    {
        first=NULL;
        n=0;
    }
    void Insert(int pos,const &x);
    void Setup();
    void Display();
    int length()
    {
        return n;
    }
    node* SetPos(int pos);
protected:
    node *first;
    int n;
};
node* LinkList::SetPos(int pos)
{
    node *q=first;
    for(int i=0;i<pos;i++)
        q=q->next;
    return q;
}
void LinkList::Setup()
{
    node *q,*p;
    node m1={{1,2,3,4,5},"小蜜蜂",1};
    q=new node;
    q=&m1;
    q->next=first;
    first=q;
    node m2={{5,4,3,2,1},"遇见",2};
    p=new node;
    p=&m2;
    p->next=q->next;
    q->next=p;
    n+=2;
}
 
void LinkList::Display()
{
    node *m=first->next;
    cout<<"歌曲库显示\n";
    for(int a=1;a<=n;a++)
    {
        cout<<a<<'.'<<m->name<<endl;
        m=m->next;
    }
}
void main()
{
    LinkList nick;
    nick.Setup();
    nick.Display();
}
提示非法..请指教.....



											
	    

	



