-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1850C.cpp
More file actions
43 lines (33 loc) · 899 Bytes
/
Copy path1850C.cpp
File metadata and controls
43 lines (33 loc) · 899 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
#include <bits/stdc++.h>
#define pb push_back
#define f(i, x, n) for(int i = x; i < n; i++)
#define endl '\n'
#define optimize() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main() {
optimize();
int t;
cin >> t;
while (t--) {
char ch;
char grid[8][8];
int beginningColumn, row, beginningPosFlag = 0;
f (i, 0, 8) {
f (j, 0, 8) {
cin >> ch;
if (ch >= 'a' && ch <= 'z' && beginningPosFlag == 0) {
beginningColumn = i;
row = j;
beginningPosFlag = 1;
}
grid[i][j] = ch;
}
}
f (i, beginningColumn, 8) {
if (grid[i][row] != '.') {
cout << grid[i][row];
}
}
cout << endl;
}
}