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
Suscribirse a:
Enviar comentarios (Atom)
9 comentarios:
es muy buieno q las personas nos muestren algo que bueno como lo es la programaion y como crear programas
me parece excelente el codigo
me gusto demasiado el tema
me gusta que personas como tu hagan cosas productivas
es bueno
fue bueno el programa
es algo interezante a donde puedo dirijirme para enterarme mas sobre programacion
la practica hace al maestro dicho a pecho se puede pulir mas codigos
Se nota que usted solo vive para el codigo no!!!
Publicar un comentario