Trees — Printing a tree

Write a program that reads a binary tree of words, and that prints it
following the format of the sample.

Input

Input consists of the description of a tree, which is a preorder
traversal of its words, marking the empty trees with ‘-1’- You can
assume that the given words have less than ten letters.

Output

Your program must print the tree following the format of the sample.
Notice that each level of the tree is printed using ten characters.

Problem information

Author: Unknown
Translator: Jordi Petit

Generation: 2026-01-25T10:10:44.203Z

© Jutge.org, 2006–2026.
https://jutge.org
