- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecoding.cpp
More file actions
Latest commit
31 lines (28 loc) · 476 Bytes
/
Copy pathDecoding.cpp
File metadata and controls
31 lines (28 loc) · 476 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
#include<iostream>
#include<cstring>
usingnamespacestd;
string res = "";
voidsol(string s){
int l = strlen(s.c_str());
// cout << "1\n";
if (l==1){
res += s;
return;
}
if (l%2==0){
res = s[0] + res;
// cout << "2\n";
} else {
res = res + s[0];
// cout << res << endl;
}
s = s.substr(1);
sol(s);
}
intmain(){
int n;
string s;
cin >> n >> s;
sol(s);
cout << res;
}