#include<stdio.h> typedef int A; const int LIST_INIT_SIZE=100; const int LISTINCRMENT=10; typedef struct { A *elem; int Length; int Listsize; int incrementsize; }List; void InitList(List &L,int maxsize=LIST_INIT_SIZE,int incresize=LISTINCRMENT) { L.elem=new A[maxsize]; L.Length=0; L.Listsize=maxsize; L.incrementsize=incresize; } bool ListEmpty(List &L) { if(L.Length==0) return true; else return false; } void ListDelete(List &L,int i,A &e) { A *p,*q; if((i<1)||(i>L.Length)) printf("i值不合法"); p=&(L.elem[i-1]); e=*p; q=L.elem+L.Length-1; for(++p;p<=q;++p) *(p-1)=*p; --L.Length; } int LocateElem(List L,A e) { int *p; int i=1; p=L.elem; while(i<=L.Length&&*p++!=e) ++i; if(i<=L.Length) return i; else return 0; } void increment(List &L) { A *a; a=new A[L.Listsize+L.incrementsize]; for(int i=0;i<L.Length;i++) a[i]=L.elem[i]; delete[]L.elem; L.elem=a; L.Listsize+=L.incrementsize; } void ListInsert(List &L,int i,A e) { A *p,*q; if(i<1||i>L.Length+1) printf("i值不合法"); if(L.Length>=L.Listsize) increment(L); q=&(L.elem[i-1]); for(p=&(L.elem[L.Length-1]);p>=q;--p) *(p+1)=*p; *q=e; ++L.Length; } void DestroyList(List &L) { delete[]L.elem; L.Listsize=0; L.Length=0; } void purge(List &La,List &Lb) { int e; InitList(La); int La_len=0; while(!ListEmpty(Lb)) { ListDelete(Lb,1,e); if(!LocateElem(La,e)) ListInsert(La,++La_len,e); } DestroyList(Lb); } int main() { List a,b; InitList(b); int n,i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&b.elem[i]); b.Length++; } purge(a,b); for(i=0;i<a.Length;i++) printf("%d ",a.elem[i]); printf(" ") ; return 0; }