直接上代码:
#include
using namespace std;
#include
struct Word {
string n;
Word* nect;
};
Word* creatlist()
{
string g = ".";
Word* head = NULL;
Word* pre = head;
while (1)
{
Word* p = new Word;
cin >> p->n;
if (head == NULL)
{
p->nect = NULL;
head = p;
pre = p;
}
else {
pre->nect = p;
pre = p;
p->nect = NULL;
}
string::size_type idx = p->n.find(g);
if (idx!=string::npos)<



