EM chào tất cả mọi người ạ! Mọi người cho em hỏi là e chạy chương trình này nó cứ bị lỗi RTE mà e không biết sửa ở đâu cho đúng. mọi người giúp em với ! Tiện mọi người cho em nỏi là dòng mà em ghi chú ở dưới đoạn code có ý nghĩa gì vậy ạ ???
#include <iostream>
#define MAX 100
using namespace std;
struct node {
int data;
node *next;
};
typedef node node;
node *Createnode(int x){
node *p=new node;
p->data=x;
p->next=NULL;
return p;
}
void PrintList(node *l){
node *p=l;
while (p!=NULL){
cout<<p->data<<" ";
p=p->next;
}
}
node *chonnode (node *p, int x){
node *temp=Createnode(x);
p->next=temp;
return temp;
}
node *xoanode(node *l){
node *p=l;
int check[MAX]= {0}; // dong nay co y nghia la gi a ???
while(p){
if(check[p->data]==0){
printf("%d ",p->data);
check[p->data]=1;
}
p=p->next;
}
}
int main (){
int n, x;
cin >>n;
cin>>x;
node *l=Createnode(x);
node *p=l;
for (int i=1; i<n; i++){
cin>>x;
p=chonnode(p,x);
}
l=xoanode(l);
PrintList(l);
return 0;
}