Square Designs
Time limit1sMemory limit1024 MB
Given M and N, print two square boxes side by side, the left with M cells across and the right with N, drawn with plus, minus, and I characters.
- Level
Easy2 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
Write a program that generates a square design like the ones below for any values of M and N (, ). Exactly ten spaces separate the two boxes, and the left box has no spaces in front of it. The output has no tabs and no trailing spaces.
Here is the output for M=5 and N=3:
+-----------+ +-------+
I-X-X-X-X-X-I I-X-X-X-I
I-X-X-X-X-X-I I-X-X-X-I
I-X-X-X-X-X-I I-X-X-X-I
I-X-X-X-X-X-I +-------+
I-X-X-X-X-X-I
+-----------+
This output contains no blank lines.
Input
A single line containing two integers, M and N.
Output
Several lines that draw the design as shown above.