Print a cross P24381


Statement
 

pdf   zip   main.cc

thehtml

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.

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