1052 Sell a cute (20point(s))
Moe Meng Da emoji usually consists of three main parts: "hand", "eye", and "mouth". For simplicity, we assume that an emoji is output in the following format:
The left hand [right hand]
now gives a set of optional symbols, please output emoticons according to the user's requirements.
Input format:
input first three lines corresponding to the optional symbol set of hand, eye, and mouth. Each symbol is enclosed in square brackets []. The title guarantees that each set has at least one symbol and no more than 10 symbols; each symbol contains 1 to 4 non-blank characters.
The next line gives a positive integer K, which is the number requested by the user. Then K lines, each line gives a user's symbol selection, the order is left-hand, left-eye, mouth, right-eye, right-hand-here only the serial number of the symbol in the corresponding set (starting from 1) is given, with spaces between the numbers Separated.
Output format:
For each user request, output the generated expressions in one line. If the serial number selected by the user does not exist, the output Are you kidding me? @/@.
Input example:
[╮][╭][o][ ][/ ] [<][>]
[╯][╰][^][-][=][>][<][@][⊙ ]
[Д][▽][_][ε][^]…
4
1 1 2 2 2
6 8 1 5 5
3 3 4 3 3
2 10 3 9 3
Output example:
╮(╯▽╰)╭
< (@Д=)/~
o( ε )o
Are you kidding me? @/@
Liu Shen's thinking, his own thinking can't run
#include<bits/stdc++.h>
using namespace std;
vector<vector<string>> sign;
int main(){
string str;
for(int i=0;i<3;++i){
getline(cin,str);
vector<string> temp;
int j=0,k=0;
for(j=0;j<str.size();++j){
if(str[j]=='['){
k=j;
while(k++<str.size()){
if(str[k]==']'){
temp.push_back(str.substr(j+1,k-j-1));
break;
}
}
}
}
sign.push_back(temp);
}
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[0].size()||d>sign[1].size()||b>sign[1].size()||e>sign[0].size()||c>sign[2].size()||a<1||b<1||c<1||d<1||e<1){
cout<<"Are you kidding me? @\\/@"<<endl;
continue;
}
cout<<sign[0][a-1]<<"("<<sign[1][b-1]<<sign[2][c-1]<<sign[1][d-1]<<")"<<sign[0][e-1]<<endl;
}
}