- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Homework.cpp
More file actions
Latest commit
37 lines (33 loc) · 575 Bytes
/
Copy pathA_Homework.cpp
File metadata and controls
37 lines (33 loc) · 575 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
#include<bits/stdc++.h>
usingnamespacestd;
intmain()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
string a;
cin >> a;
int m;
cin >> m;
string b, c;
cin >> b >> c;
for (int i = 0; i < m; i++)
{
if (c[i] == 'V')
{
a = b[i] + a;
}
else
{
a += b[i];
}
}
cout << a << "\n";
}
return0;
}