miércoles, 22 de agosto de 2007

problemas tipo maraton

estos son unos problemas tipo maraton, si depronto das con la solucion no dudes en intercambiar codigos con migo espero codigos en C++, Jcreator, Eclipse (Java o C) este es mi correo neo-vitacoranegra666@hotmail.com


Simple Text Processor


Problem Statement


You are given a list of words containing an even number of elements n. You want to place the words into two columns. The first n/2 elements of words must be placed in the first column, and the last n/2 elements of words must be in the second column. The order of the words in the input must be preserved. Each column must be formatted as follows:


The first element of the resulting output must contain the first elements of each of the two columns, the second element of the result must contain the second elements of both columns and so on. Each of the columns must be as narrow as possible; in other words, the width of each of the columns must be equal to the length of the longest word it contains. For each column, the width of each row must be the same (but the widths of the rows in the first and in the second columns may differ). If some words in a column are narrower than the width of the column, they must be padded with spaces. The words in the first column must be aligned to the left (so, all spaces will be added to the right side of words that require them), and the words in the second column must be aligned to the right. The columns must be separated by a single character column containing only'*'.


Input


Input consist of several test cases, each test case consist of a list of words ended with a # character. Each list will have an even number of words, between 2 and 50 inclusive. Each Word won’t have more tan 20 characters, each of them a lowercase letter (‘a’-‘z’)


Output


Print each test case in the two-column format explained above. Print a single end line between each case.


Sample Input


a
b
c
d
#
simple
test
#
this
software
includes
a
number
of
subcomponents
with
separate
copyright
notices
and
license
terms
#


Sample Output


a*c
b*d


simple*test


this * with
software * separate
includes *copyright
a * notices
number * and
of * license
subcomponents* terms


9 comentarios:

Unknown dijo...

es muy buieno q las personas nos muestren algo que bueno como lo es la programaion y como crear programas

Unknown dijo...

me parece excelente el codigo

Anónimo dijo...

me gusto demasiado el tema

juancamilo dijo...

me gusta que personas como tu hagan cosas productivas

Anónimo dijo...

es bueno

Anónimo dijo...

fue bueno el programa

Unknown dijo...

es algo interezante a donde puedo dirijirme para enterarme mas sobre programacion

josetf dijo...

la practica hace al maestro dicho a pecho se puede pulir mas codigos

Anónimo dijo...

Se nota que usted solo vive para el codigo no!!!