solution
- 想要输出
\
需要用\\
才能输出,即
cpp
cout << "Are you kidding me? @\\/@" << endl;
- 测试点1,2:输入序号小于1的非法情况
cpp
#include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
string s, ans, t;
int k, cnt1 = 1, cnt2 = 1, cnt3 = 1, lh, rh, le, re, m;
map<int, string> hands, eyes, mouths;
for(int i = 0; i < 3; i++){
getline(cin, s);
for(int j = 0; j < s.size(); j = k + 1){
if(s[j] == '['){
for(k = j; s[k] != ']'; k++);
if(i == 0) hands[cnt1++] = s.substr(j + 1, k - j - 1);
else if(i == 1) eyes[cnt2++] = s.substr(j + 1, k - j - 1);
else mouths[cnt3++] = s.substr(j + 1, k - j - 1);
}
else k = j;
}
}
cin >> k;
while(k--){
cin >> lh >> le >> m >> re >> rh;
if(lh >= cnt1 || rh >= cnt1 || le >= cnt2 || re >= cnt2 || m >= cnt3 || lh <= 0 || le <= 0 || m <= 0 || re <= 0 || rh <= 0) cout << "Are you kidding me? @\\/@" << endl;
else cout << hands[lh] + "(" + eyes[le] + mouths[m] + eyes[re] + ")"+ hands[rh] << endl;
}
return 0;
}