-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5356.cpp
More file actions
50 lines (46 loc) · 735 Bytes
/
5356.cpp
File metadata and controls
50 lines (46 loc) · 735 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
48
49
50
// 5356. 의석이의 세로로 말해요
// 2020.01.27
#include<iostream>
#include<string>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
for (int testCase = 1; testCase <= t; testCase++)
{
char map[5][16];
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 16; j++)
{
map[i][j] = '.';
}
}
for (int i = 0; i < 5; i++)
{
string s;
cin >> s;
for (int j = 0; j < s.size(); j++)
{
map[i][j] = s[j];
}
}
string ans = "";
for (int i = 0; i < 16; i++)
{
for (int j = 0; j < 5; j++)
{
if (map[j][i] != '.')
{
ans += map[j][i];
}
}
}
cout << "#" << testCase << " " << ans << "\n";
}
return 0;
}