-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11586.cpp
More file actions
53 lines (50 loc) · 718 Bytes
/
11586.cpp
File metadata and controls
53 lines (50 loc) · 718 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
51
52
53
// 11586. 지영 공주님의 마법 거울
// 2019.05.22
// 문자열 처리
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
vector<string> v;
for (int i = 0; i < n; i++)
{
string s;
cin >> s;
v.push_back(s);
}
int k;
cin >> k;
vector<string> ans;
switch (k)
{
case 1:
for (int i = 0; i < n; i++)
{
ans.push_back(v[i]);
}
break;
case 2:
for (int i = 0; i < n; i++)
{
reverse(v[i].begin(), v[i].end());
ans.push_back(v[i]);
}
break;
case 3:
for (int i = n - 1; i >= 0; i--)
{
ans.push_back(v[i]);
}
break;
}
for (int i = 0; i < n; i++)
{
cout << ans[i] << endl;
}
return 0;
}