poj2013
idea: since the beginning of the input is increasing so you can take advantage of this condition, no recursion, really want to take advantage of the full meaning of the questions ah. Where n i is the condition for the determination of the odd or even very harsh, very coherent.
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
using namespace std;
string str[30];
int n;
int kase=0;
int main()
{
while(cin>>n&&n)
{
printf("SET %d\n",++kase);
for(int i = 1;i<=n;++i)
cin>>str[i];
for(int i=1;i<=n;i+=2)
cout<<str[i]<<endl;
for(int i=n-(n%2);i>1;i-=2)
cout<<str[i]<<endl;
}
return 0;
}