Keywords: vector<vector >sign_map ;two dimensional vector; vector str_input; string.size();
string.length();string.substr(pos_start,pos_end); sign_map.push_back();
AC CODE:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<vector<string> > sign_map;
for(int i = 0 ; i < 3 ; i ++){
string str_input;
getline(cin,str_input);
vector <string> row ;//在一行中输入的所有字符
int j = 0,k = 0 ;//j 和 k 分别储存记录'[' 和']'的下标
while(j < str_input.length()){
if(str_input[j] == '['){
//cout<<j<<endl;
while( k < str_input.length()){
if(str_input[k] == ']'){
//cout<<k<<endl;
row.push_back(str_input.substr(j+1,k-j-1));
//cout<<str_input.substr(j+1,k-j-1)<<" "<<j<<" "<<k<<endl;
k++;
break;
}
k++;
}
}
j++;
}
sign_map.push_back(row);//把每一行row 的筛选结果储存到sign——map中
//这样sign_map中就是最终的所有 手 眼 口 符号集
}
int n;
cin>>n;
for(int i = 0 ; i < n ; i++){
int a , b , c , d ,e ;
cin>>a>>b>>c>>d>>e;
if(a > sign_map[0].size() || b > sign_map[1].size() || c >sign_map[2].size()||d > sign_map[1].size()||e >sign_map[0].size() || a < 1||b < 1|| c < 1|| d < 1 || e < 1){
cout<<"Are you kidding me? @\\/@"<<endl;
continue;
}
else{
cout<<sign_map[0][a-1]<<"("<<sign_map[1][b-1]<<sign_map[2][c-1]<<sign_map[1][d-1]<<")"<<sign_map[0][e-1]<<endl;
}
}
return 0;
}