#K63342. Tile Pattern Generation
Tile Pattern Generation
Tile Pattern Generation
You are given an integer N, which represents the size of a square grid (i.e. N×N grid). Your task is to generate a pattern consisting of N rows where each row is a string of length N. Each row always begins with a black tile represented by the character #
followed by N - 1 white tiles represented by the character .
.
In other words, for any row, the output is:
[
+ \underbrace{.\ .\ \cdots\ .}_{N-1 \text{ times}}
]
Example: If N = 5, then the expected pattern is:
#.... #.... #.... #.... #....
This problem tests your ability to handle simple string manipulation and input/output operations.
inputFormat
The input consists of a single integer N provided via stdin. This integer represents both the number of rows and the number of columns of the grid.
Input Format:
N
Constraints: N is a positive integer (N ≥ 1).
outputFormat
Print the tile pattern to stdout with each row on a new line. Each row must start with a '#' followed by N-1 dots ('.').
Output Format:
# followed by N-1 dots # followed by N-1 dots ... (total N rows)## sample
5
#....
#....
#....
#....
#....
</p>