#P1598. [USACO03FEB] 垂直柱状图 Vertical Histogram

[USACO03FEB] 垂直柱状图 Vertical Histogram

Description

Write a program that reads four lines of uppercase letters from the input (all uppercase, each line has at most 100100 characters), and then outputs a histogram showing how many times each character appears in the input. Format your output exactly as in the sample output.

Input Format

Four lines of characters consisting of uppercase letters, each line has at most 100100 characters.

Output Format

Consists of several lines. The first lines are made up of spaces and asterisks, and the last line is made up of spaces and letters. Do not print any unnecessary trailing spaces at the end of any line. Do not print any blank lines.

THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.
THIS IS AN EXAMPLE TO TEST FOR YOUR
HISTOGRAM PROGRAM.
HELLO!

                            *
                            *
        *                   *
        *                   *     *   *
        *                   *     *   *
*       *     *             *     *   *
*       *     * *     * *   *     * * *
*       *   * * *     * *   * *   * * * *
*     * * * * * *     * * * * *   * * * *     * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Hint

No trailing spaces are allowed at the end of each output line.

Translated by ChatGPT 5