poj 2013 Symmetric Order

今天早上水过的第3题,简单的字符串处理,其实我只用了输出处理,连排序都没用。。。

#include <stdio.h>

int main()
{
	int n;
	int i;
	char string[20][30];
	int count=0;

	while(scanf("%d",&n))
	{
		if(n==0)
			break;

		for(i=1;i<=n;i++)
		{
			scanf("%s",string[i]);
			//printf("%s\n",string[i]);
		}

		printf("SET %d\n",++count);

		for(i=1;i<=n;i+=2)
			printf("%s\n",string[i]);

		if(n%2!=0)
			n--;

		for(i=n;i>=2;i-=2)
			printf("%s\n",string[i]);
	}

	return 0;
}
时间: 2024-09-15 06:16:40

poj 2013 Symmetric Order的相关文章

dotCloud say PostgreSQL does not scale for High Availability on the dotCloud Platform

dotCloud是cloudControl提供的一个商业PaaS产品.  About the dotCloud Platform The dotCloud Platform is a service provided by cloudControl, Inc. The Platform launched in 2011 as the industry's first multi-language Platform as a Service. The Platform simplifies app

数据库的方向 - 行vs列

前言: 转载的好文不多,但此篇的确是难得一见的好文,如若不信,请仔细阅读. 此篇文章没有波涛汹涌的起伏,没有繁多的代码,只有悠然自得的文笔. 因此,分享此文给大家. 翻译原文链接:https://www.ibm.com/developerworks/community/blogs/IBMi/entry/database?lang=en 英文原文链接:http://ibmsystemsmag.blogs.com/you_and_i/db2/ 数据库的方向 - 行vs列 如果你是一位数据库专家的话,

POJ题目分类

初期: 一.基本算法:      (1)枚举. (poj1753,poj2965)      (2)贪心(poj1328,poj2109,poj2586)      (3)递归和分治法.      (4)递推.      (5)构造法.(poj3295)      (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:      (1)图的深度优先遍历和广度优先遍历.      (2)最短路径算法(dijkstra,bellman-ford

POJ:DNA Sorting 特殊的排序

Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', this measure is 5, since D is greater than four letters to

Mysql中按月和日为组group并进行统计排序order

在数据库中我们经常用sql语句对表进行简单的统计排序,对于日期字段,我们可以简单的对其进行order.对于复杂一点的可以按日期中的年,月,日分别进行group,order. 按年份进行group,统计排序: SELECT YERA(established_time)  ,COUNT(*) AS num <span style="font-size: 13.75px; font-family: Arial, Helvetica, sans-serif;">FROM `tabl

poj 1639 Picnic Planning:最小度限制生成树

链接: http://poj.org/problem?id=1639 题目: Picnic Planning Time Limit: 5000MS     Memory Limit: 10000K Total Submissions: 7780     Accepted: 2726 Description The Contortion Brothers are a famous set of circus clowns, known worldwide for their incredible

poj 1094 Sorting It All Out(拓扑排序)

链接: http://poj.org/problem?id=1094 题目: Sorting It All Out Time Limit: 1000MS     Memory Limit: 10000K Total Submissions: 21532     Accepted: 7403 Description An ascending sorted sequence of distinct values is one in which some form of a less-than ope

UVa 755 / POJ 1002 487--3279 (排序)

755 - 487--3279 Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=98&page=show_problem&problem=696 http://poj.org/problem?id=1002 Businesses like to have memorable telephone numbers. On

POJ 2559 / HDU 1506 Largest Rectangle in a Histogram (DP)

Largest Rectangle in a Histogram http://poj.org/problem?id=2559 Time Limit: 1000MS Memory Limit: 65536K Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may