-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy path746 B. Decoding.cpp
More file actions
37 lines (33 loc) · 791 Bytes
/
746 B. Decoding.cpp
File metadata and controls
37 lines (33 loc) · 791 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
//============================================================================
//problem link:http://codeforces.com/contest/746/problem/B
// Name : .cpp
// Author : mohand sakr
// Version :
// Copyright : use it under your responsibility
// Description : Hello World in C++, Ansi-style
//status:accepted
//============================================================================
#include <iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int len;
string s;
cin>>len;
cin>>s;
vector<char> vect;
while(len!=0){
if(len%2==1){
vect.push_back(s[0]);
}else{
vect.insert(vect.begin(),s[0]);
}
s.erase(0,1);
len=s.length();
}
for(int i=0;i<vect.size();i++){
cout<<vect[i];
}
return 0;
}