#include <iostream>
#include <string>
using namespace std;
class person
{
public:
string name;
person *Rlink;
// person *Llink;
};
void main()
{
person *first=NULL;
person *last=NULL;
person *current=NULL;
person *newnode=NULL;
newnode=new person;
newnode->name="a";
newnode->Rlink=NULL;
first=last=newnode;
for(int i=0;i<5;i++)
{
newnode=new person;
newnode->name="a";
newnode->Rlink=NULL;
last->Rlink=newnode;
last=newnode;
}
for(current=first;current->name!="c"&¤t!=NULL; //注意这一行,这一行的"C"改成"a"就错了,为什么
current=current->Rlink);
if(current==NULL)
{
cout<<"没有要找的数";
}
else
{
cout<<current->name;
}
}