Thank anh.
Bạn chủ tóp pic có thể tham khảo cái mình đã edit.
Mã:
#include<iostream.h>
#include<conio.h>
typedef int ElementType;
typedef struct Node{
ElementType Element;
struct Node *link;
}List;
void Make_L(List **first)
{
(*first)= NULL;
}
void taods(List **L, int x)
{
List *p;
p=new List;
p->Element=x;
p->link=*L;
*L=p;
}
void xuatds(List *L)
{List *p;
p=L;
while (p!=NULL)
{cout<<p->Element<<" ";
p=p->link;
}
cout<<"\n";
}
void main()
{
clrscr();
List *L;
int x,dk=1; char y;
Make_L(&L);
while(dk)
{cout<<"x=";
cin>>x;
taods(&L,x);
cout<<"Co muon nhap nua khong, Bam C de tiep tuc nhap. Bam phim bat ky de xuat danh sach. hehe. \n";
cin>>y;
if (y=='c')
dk=1;
else dk=0;
}
xuatds(L);
getch();
}