#include <iostream>
#include <string.h>
using namespace std;
int main() {
char code[2048];
int col,len,row;
for(;cin>>col&&col;){
cin>>code;
len=strlen(code);
row=len/col;
for(int j=0;j<col;++j)
for(int i=0;i<row;++i) {
if(i&1) {
cout<<code[i*col+col-j-1];
} else {
cout<<code[i*col+j];
}
}
cout<<endl;
}
return 0;
}
Monday, 4 May 2009
POJ 2039
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment