//链表节点
struct LNode{
	char data;
	struct LNode *next;
};
int match(struct LNode *A, struct LNode *B){
	struct LNode *p=A->next;
	int index=1;
	while(p!=NULL){
		struct LNode *m=p;
		struct LNode *q=B->next; //每次匹配,q从头开始
		while(m!=NULL&&q!=NULL){
			if(m->data!=q->data)
				break; //子串失败
			m=m->next;
			q=q->next;
		}
		if(q==NULL) //B完全匹配
			return index;
		p=p->next;
		index++;
	}
	return -1;
}