Print a cross P24381


Statement
 

pdf   zip   main.cc

Write a procedure

    void cross(int n, char c);

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

    cross(5, 'X');

produces this output:

  X
  X
XXXXX
  X
  X

Precondition

@n@ 3\ge 3, @n@ is odd.

Observation

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

Information
Author
Salvador Roura
Language
English
Translator
Salvador Roura
Original language
Catalan
Other languages
Catalan
Official solutions
C++
User solutions
C++