Print a cross

Write a procedure

        void cross(int n, char c);

to print an n × n cross with the character @c@. For instance, the call

        cross(5, 'X');

produces this output:

      X
      X
    XXXXX
      X
      X

Precondition

@n@  ≥ 3, @n@ is odd.

Observation

You only need to submit the required procedure; your main program will
be ignored.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:21:27.431Z

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