#t54. 小杨的 X 字矩阵
小杨的 X 字矩阵
Xiaoyang's X Matrix
Problem Description
Xiaoyang wants to construct an X-shaped matrix ( is odd). Both diagonals of this matrix are the half-width plus sign +, and all the other positions are the half-width minus sign -. For example, a X-shaped matrix is as follows:
+---+
-+-+-
--+--
-+-+-
+---+
Please help Xiaoyang print the corresponding "X matrix" for the given .
Input Format
One line containing one integer .
Output Format
Output the corresponding "X matrix".
Strictly follow the required format: do not add any spaces, punctuation, blank lines, or any other symbols on your own. You should output exactly lines, each line containing exactly characters besides the newline — each of which is either + or -.
Sample Input
Sample Input 1
5
Sample Input 2
7
Sample Output
Sample Output 1
+---+
-+-+-
--+--
-+-+-
+---+
Sample Output 2
+-----+
-+---+-
--+-+--
---+---
--+-+--
-+---+-
+-----+
Sample Explanation
For sample input 1, . The main diagonal (row , column ) and the anti-diagonal (row , column ) are +, and all other positions are -. So a X-shaped matrix is generated as shown in the output.
Constraints
For all data, , and is guaranteed to be odd.