-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1052.cpp
More file actions
47 lines (44 loc) · 846 Bytes
/
1052.cpp
File metadata and controls
47 lines (44 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
vector<vector<string>> a;
for(int i =0;i<3;i++){
string s;
//cin>>s;
getline(cin,s);
int j=0,k=0;
vector<string> tmp;
while(j<s.length()){
if(s[j]=='['){
k=j+1;
while(k++<s.length()){
if(s[k]==']')
{
tmp.push_back(s.substr(j+1,k-1-j));
break;
}
//k++;
}
}
j++;
}
a.push_back(tmp);
}
int n;
cin >> n;
int f1,f2,f3,f4,f5;
int l1=a[0].size(),l2=a[1].size(),l3=a[2].size();
for(int i=0;i<n;i++){
cin>>f1>>f2>>f3>>f4>>f5;
if(f1>l1||f1<1||f2>l2||f2<1||f3>l3||f3<1||f4>l2||f4<1||f5>l1||f5<1){
cout<<"Are you kidding me? @\\/@"<<endl;
continue;
}else{
cout<<a[0][f1-1]<<"("<<a[1][f2-1]<<a[2][f3-1]<<a[1][f4-1]<<")"<<a[0][f5-1]<<endl;
}
}
system("pause");
return 0;
}