#include <iostream>
#include <cstdio>
#define MAX_N 2005
using namespace std;
int N;
char S[MAX_N];
void solve()
{
int a = 0, b = N-1;
int cnt = 0;
while(a <= b)
{
bool left = false;
for(int i = 0; a+i < b; i++)
{
if(S[a + i] < S[b - i])
{left = true; break;}
else if(S[a + i] > S[b - i])
{left = false; break;}
}
if(left) putchar(S[a++]);
else putchar(S[b--]);
if(!(++cnt%80)) putchar('\n');
}
putchar('\n');
}
int main()
{
cin >> N;
int i = N ;
for(int i = 0; i < N; i++)
cin >> S[i];
solve();
return 0;
}
因为没看懂题,忽略了输出时每行至多80个字符的条件,导致一直Presentation Error