第二个测试点未过,有段错误
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int get1(string a,vector<string> &vec){
string temp="";
for(int i=0;i<a.length();i++){
if(a[i]!='['&&a[i]!=']'&&a[i]!=' '){
temp+=a[i];
}
if(a[i]==']'){
vec.push_back(temp);
temp="";
}
}
return 0;
}
int main(){
int K,num,len1,len2,len3;
string c,b,d;
vector<string> hand1,hand2,eye,mouse,face;
vector<vector<string> > cab;
getline(cin,c);
getline(cin,b);
getline(cin,d);
get1(c,hand1);
get1(b,eye);
get1(d,mouse);
len1=hand1.size();
len2=eye.size();
len3=mouse.size();
int len[5]={len1,len2,len3,len2,len1};
cab.push_back(hand1);
cab.push_back(eye);
cab.push_back(mouse);
cab.push_back(eye);
cab.push_back(hand1);
cin>>K;
for(int i=0;i<K;i++){
int flag=1;
for(int j=0;j<5;j++){
cin>>num;
if(num>cab[j].size()){
flag=0;
break;
}else{
if(j==1){
face.push_back("(");
}else if(j==4){
face.push_back(")");
}
face.push_back(cab[j][num-1]);
}
}
if(flag==1){
for(int j=0;j<face.size();j++){
if(j==face.size()-1){
cout<<face[j]<<endl;
}else{
cout<<face[j];
}
}
}else{
cout<<"Are you kidding me? @\\/@"<<endl;
}
face.clear();
}
return 0;
}