首页 > 其他 > 详细

二进制

时间:2018-03-07 11:04:09      阅读:210      评论:0      收藏:0      [点我收藏+]

/*http://poj.org/problem?id=2013*/

问题描述:重新输出字符串组,两端最短,中间 最长
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

const int MAXM = 25 + 1;
const int MAXN = 15;

int main()
{
 int t = 0;
 int N;
 char names[MAXN][MAXM];
 while (scanf("%d", &N) && N)
 {
  int top = 0, bottom = N - 1;
  for (int i = 0; i < N; ++i)
  {
   if (i & 1)
   {
    scanf("%s", &names[bottom]);
    bottom--;  
   }
   else
   {
    scanf("%s", &names[top]);
    top++;
   }
  }
  printf("SET %d\n", t + 1);
  for (int i = 0; i < N; ++i)
  {
   printf("%s\n", names[i]);
  }

  t++;
 }

 return 0;
}

二进制

原文:https://www.cnblogs.com/unknownname/p/8520819.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!