您的位置:首页 > 其它

111

2016-09-27 20:32 190 查看
1111

test

#include<iostream>

#include<string>

#include<sstream>

using namespace std;

char symbol[3][10][4]{0};

void output(int temp, int i){
//int k = 0;
cout << symbol[i][temp - 1];
//while (symbol[i][temp - 1][k] != 0){
// cout << symbol[i][temp - 1][k];
// k++;
//}

}

int main(){

string line;
char ch;
int len[3];
for (int i = 0; i != 3; i++){
getline(cin, line);
istringstream stream(line);
int j = 0, k = 0;
bool beg = false;
while (stream >> ch){
switch (ch){
case '[':
beg = true;

break;
case ']':
beg = false;
j++;
k = 0;
break;
default:
if (beg){
//cout << ch;
symbol[i][j][k] = ch;
k++;
break;
}
}
}
len[i] = j;
}
int n, a, b, c, d, e;
cin >> n;
for (int i = 0; i != n; i++){
cin >> a >> b >> c >> d >> e;
if (a<1||a>len[0]||b<1||b>len[1]||c<1||c>len[2]||d<1||d>len[1]||e<1||e>len[0])
cout << "Are you kidding me? @\\/@"<<endl;
//else
//if (symbol[0][a - 1][0] == 0 ||
// symbol[1][b - 1][0] == 0 ||
// symbol[2][c - 1][0] == 0 ||
// symbol[1][d - 1][0] == 0 ||
// symbol[0][e - 1][0] == 0)
// cout << "Are you kidding me? @\\/@"<<endl;
else
{
output(a, 0);
cout << '(';
output(b, 1);
output(c, 2);
output(d, 1);
cout << ')';
output(e, 0);
cout << endl;
}

}

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: