Code:

#include "conio.h"
#include "stdio.h"
#include "alloc.h"
#include "values.h"

typedef unsigned int Position;
typedef int ElementType;
typedef struct Node {
   ElementType Element;
   Node *Next;
};
typedef Node *List;

//khoi tao danh sach rong
List MakeNull_List(){
   List Header = (List)malloc(sizeof(List));
   (Header)->Next = NULL;
   return Header;
}
//kiem tra danh sach rong
char Empty_List(List L) {
   return L->Next == NULL;
}
//Khoi tao 1 node
Node *Make_Node(ElementType X) {
   Node *temp = (Node*)malloc(sizeof(Node));
   temp->Element = X;
   temp->Next = NULL;
   return temp;
}
//xen mot phan tu vao danh sach
void Insert_List(ElementType X, List P) {
   Node *Temp = Make_Node(X);
   Temp->Next = P->Next;
   P->Next = Temp;
}
//xoa 1 Node khoi danh sach L
void Delete_List(List L) {
   Node * p = L->Next;
   L->Next = p->Next;
   free(p);
}
//nhap dach sach co n phan tu
List Input_List(int n) {
   List L = MakeNull_List();
   ElementType x;
   for(int i = 1; i<=n; i++) {
      printf("\tElement %d = ",i);
      scanf("%d",&x);
      Insert_List(x,L);
   }
   return L;
}
//xuat danh sach cac so nguyen
void Out_List(List L) {
   List temp = L;
   while(!Empty_List(temp)) {
      printf("%d\t",temp->Next->Element);
      temp = temp->Next;
   }
}
//xoa cac phan tu trung trong danh sach
void Delete(List L) {
   List temp = L;
   List temp1;
   while(temp->Next!=NULL) {
      temp1 = temp->Next;
      while(temp1->Next!=NULL)
      {
         if(temp->Next->Element == temp1->Next->Element)
            Delete_List(temp1);
         else
            temp1 = temp1->Next;
      }
      temp = temp->Next;
   }
}
//the main programming
void main() {
   clrscr();
   ElementType x;
   int n,i;
   printf("Nhap so phan tu n = ");
   scanf("%d",&n);
   List L = Input_List(n);
   printf("Danh sach vua nhap:\n");
   Out_List(L);
   Delete(L);
   printf("\nDanh sach moi:\n");
   Out_List(L);
   getch();
}