-->
当前位置:首页 > 题库

PROGRAMMING:matrix

Luz5年前 (2021-05-10)题库415
###Square array
```
Please program to output the following regular n * n matrix( This question is provided by Ms. Huang Yuyan.)
*UUUUUUUU*
L*UUUUUU*R
LL*UUUU*RR
LLL*UU*RRR
LLLL**RRRR
LLLL**RRRR
LLL*DD*RRR
LL*DDDD*RR
L*DDDDDD*R
*DDDDDDDD*
Among them, the symbol on the diagonal is * and the symbols in the other four areas are udlr, representing up, down, left and right.
In particular, when n = 1, the output:
*
When n = 2, output:
**
**
```
###Input format:
```
The input is a positive integer (1-50).
```
###Output format:
Output square array as required.
###Input sample 1:
```in
three
```
###Output sample 1:
```out
*U*
L*R
*D*
```
###Input sample 2:
```in
five
```
###Output sample 1:
```out
*UUU*
L*U*R
LL*RR
L*D*R
*DDD*
```






answer:If there is no answer, please comment