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;
}
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;
}
相关文章推荐
- 111
- 111
- 111
- 判断是否是简单密码,不能包含相同的字符(如aaa,111),递增序列(abc,123),递减序列(cda,321)
- 111
- 111
- UVa 111
- 111
- 111
- UVA 111 History Grading
- UVA 111 - History Grading
- scala111
- 111
- svc: failed to register lockdv1 RPC service (errno 111).
- 海监111钓鱼岛维权 原属海军5000吨级破冰船
- sgu-111-111. Very simple problem(java大数)
- UVa 111 - History Grading 最长递增子序列 LIS
- UVa 111 - History Grading
- 111
- rsync: failed to connect to x.x.x.x: Connection refused (111)