标签:
7
Bo
Pat
Jean
Kevin
Claude
William
Marybeth
6
Jim
Ben
Zoe
Joey
Frederick
Annabelle
5
John
Bill
Fran
Stan
Cece
0
set-1
Bo
Jean
Claude
Marybeth
William
Kevin
Pat
set-2
Jim
Zoe
Frederick
Annabelle
Joey
Ben
set-3
John
Fran
Cece
Stan
Bill
#include <iostream>
using namespace std;
int main(){
int n,i,k,num=1;
string a[100],b[100];
while(cin>>n&&n!=0){
k=0;
for(i=0;i<n;i++){
cin>>a[i];
}
for(i=0;i<n;i=i+2){
if(i==n-1){
b[k]=a[i];
}else{
b[k]=a[i];
b[n-1-k]=a[i+1];
k=k+1;
}
}
cout<<"set-"<<num++<<endl;
for(i=0;i<n;i++){
cout<<b[i]<<endl;
}
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/lchzls/p/5781742.html