码迷,mamicode.com
首页 > 其他好文 > 详细

POJ刷题(2013)

时间:2015-04-16 19:55:04      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:算法   poj   

程序(已经accepted):

#include <stdio.h>

int main()
{
    char name[15][26];
    int n, i;
    int N = 1;
    while(scanf("%d\n", &n) == 1 && n)
    {
        for(i=0; i<n; i++)
            gets(name[i]);
        printf("SET %d\n", N++);
        for(i=0; i<n; i+=2)
            puts(name[i]);
        for(i=n-1-(n&1); i>=0; i-=2)
            puts(name[i]);
    }
    return 0;
}


POJ刷题(2013)

标签:算法   poj   

原文地址:http://blog.csdn.net/xumesang/article/details/45013303

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!