#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,q=0;
string a,b,c;
while(cin>>n>>m)
{
if(n!=m)
{
for(int i=1;i<=n;i++)
{
cin>>a;
b=b+a;
}
for(int o=1;o<=m;o++)
{
cin>>c[q];
q++;
}
for(int w=0;w<=m;w++)
{
cout<<b.at(c[w]);
}
cout<<endl;
}
else
break;
}
return 0;
}
系統呼叫了 abort 函式! terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 51) >= this->size() (which is 35) Aborted (core dumped)
:P