作业保持感觉。
AC:
#include <iostream>
#include <cstring>
using namespace std;
int main() {
int size;
while(cin >> size && size != 0) {
string tmpWord;
cin >> tmpWord;
char word[200][size];
memset(word, '0', sizeof(word));
int count = 0;
for(int i = 0; i < 200; i++) {
if(tmpWord[count] == '\0') {
break;
}
if(i % 2 ==0) {
for(int j = 0; j < size; j++) {
word[i][j] = tmpWord[count++];
}
}
else {
for(int j = size - 1; j >= 0; j--) {
word[i][j] = tmpWord[count++];
}
}
}
for(int i = 0; i < size; i++) {
for(int j = 0; j < 200; j++) {
if(word[j][i] != '0') {
cout << word[j][i];
}
}
}
cout << endl;
}
return 0;
}