if(NODE.find(a[i])>NODE.find(a[i+1]))
{
b=a[i];
a[i]=a[i+1];
a[i+1]=b;
}
}
void eclouse(char c,string &he,edge b[])
{
int k;
for(k=0;k{
if(c==b[k].first[0])
if(b[k].change=="*")
{
if(he.find(b[k].last)>he.length())
he+=b[k].last;
eclouse(b[k].last[0],he,b);
}
}
}
void move(chan &he,int m,edge b[])
{
int i,j,k,l;
k=he.ltab.length();
l=he.jihe[m].length();
for(i=0;ifor(j=0;jif((CHANGE[m]==b[j].change[0])&&(he.ltab[i]==b[j].first[0])) if(he.jihe[m].find(b[j].last[0])>he.jihe[m].length()) he.jihe[m]+=b[j].last[0];
for(i=0;ifor(j=0;jif((CHANGE[m]==b[j].change[0])&&(he.jihe[m][i]==b[j].first[0] ))
if(he.jihe[m].find(b[j].last[0])>he.jihe[m].length()) he.jihe[m]+=b[j].last[0];
}
//输出
void outputfa(int len,int h,chan *t)
{
int i,j,m;
cout<<" I ";
for(i=0;icout<<'I'<cout<for(i=0;i{
cout<<' '<m=t[i].ltab.length();
for(j=0;j{
kong(8-m);
m=t[i].jihe[j].length();
cout<}
cout<}
}
void main()
{
edge *b=new edge[MAXS];
int i,j,k,m,n,h,x,y,len;
bool flag;
string jh[MAXS],endnode,ednode,sta;
cout<<"请输入NFA各边信息(起点条件[空为*] 终点),以#结束:"<{
cin>>b[i].first;
if(b[i].first=="#") break;
cin>>b[i].change>>b[i].last;
}
N=i;
/*for(j=0;jcout<
for(i=0;i{
if(NODE.find(b[i].first)>NODE.length())
NODE+=b[i].first;
if(NODE.find(b[i].last)>NODE.length())
NODE+=b[i].last;
if((CHANGE.find(b[i].change)>CHANGE.length())&&(b[i].change!="* "))
CHANGE+=b[i].change;
}
len=CHANGE.length();
cout<<"结点中属于终态的是:"<cin>>endnode;
for(i=0;iif(NODE.find(endnode[i])>NODE.length())
{
cout<<"所输终态不在集合中,错误!"<