标签:
1 #include <stdio.h> 2 #include <string.h> 3 char strs[16][30]; 4 char result[16][30]; 5 int main() 6 { 7 int n,time = 0,i; 8 while(scanf("%d",&n) && n) 9 { 10 ++time; 11 i = 0; 12 for(i = 0; i < n; ++i) 13 scanf(" %s",strs[i]); 14 15 int rn = n-1,j = 0; 16 17 for(i = 0; i < n; ++i) 18 { 19 if((i+1)%2 == 1) 20 { 21 strcpy(result[j],strs[i]); 22 ++j; 23 } 24 else 25 { 26 strcpy(result[rn],strs[i]); 27 --rn; 28 } 29 } 30 printf("SET %d\n",time); 31 for(i = 0; i < n; ++i) 32 { 33 printf("%s\n",result[i]); 34 } 35 } 36 return 0; 37 }
标签:
原文地址:http://www.cnblogs.com/guoyongheng/p/5762475.html