#include<bits/stdc++.h>
using namespace std;
int main()
{
string an;
int n;
while(cin >> n && n!= 0)
{
cin >> an;
string ch = "", ar = "";
int l = an.size();
int r = l/n, j = 0, i;
for(i=0;i<l;i++)
{
ch += an[i];
j++;
if(j == r)
{
reverse(ch.begin(), ch.end());
ar += ch;
ch.clear();
j = 0;
}
}
cout << ar << endl;
}
return 0;
}
using namespace std;
int main()
{
string an;
int n;
while(cin >> n && n!= 0)
{
cin >> an;
string ch = "", ar = "";
int l = an.size();
int r = l/n, j = 0, i;
for(i=0;i<l;i++)
{
ch += an[i];
j++;
if(j == r)
{
reverse(ch.begin(), ch.end());
ar += ch;
ch.clear();
j = 0;
}
}
cout << ar << endl;
}
return 0;
}
Comments
Post a Comment