#include#include #include using namespace std;typedef struct node{ char c; int i; struct node* next; }Node;#define N 10char a[N][N];int main(){ string s,str; Node* headerPtr=NULL; Node *cur,*pre; while(cin>>s&&s!="THEEND") { int size=s.length(); for(int i=0;i c=s[i]; temp->i=i+1; temp->next=NULL; pre=cur=headerPtr; while(cur!=NULL) { if(s[i]>=cur->c) { pre=cur; cur=cur->next; } else { break; } } if(cur==headerPtr) { temp->next=headerPtr; headerPtr=temp; } else { pre->next=temp; temp->next=cur; } } cin>>str; int sizeStr=str.length(); int h=sizeStr/size; int l=0; while(headerPtr!=NULL) { //cout< c<<"***"< i< i; for(int k=0;k next; delete temp; } for(int i=0;i