#include <iostream>
#include <stack>
#include <string>
#include <fstream>
using namespace std;
struct node {
string data;
struct node *next;
};
int main() {
node *test=new node[10];
test[0].data="cxftest1";
test[0].next=&test[1];
test[1].data="cxftest2";
test[1].next=&test[2];
test[2].data="cxftest3";
test[2].next=&test[3];
for(int a=0;a<=2;a++) {
if(test[a].next!=nullptr) {
cout<<test[a].data<<endl;
}
}
cout<<endl;
test[1].next=nullptr;
for(int a=0;a<=2;a++) {
if(test[a].next!=nullptr) {
cout<<test[a].data;
}
}
}