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

PROGRAMMING:Character diamond

Luz5年前 (2021-05-10)题库500
According to the characters read in and the length of the side, draw the character diamond.
###Input format:
The input data contains several groups of data, each group of data includes a visible character c and an integer n (1 ≤ n ≤ 30).
Enter ^ Z with the keyboard or end the data entry when the end of the file is encountered.
###Output format:
Output a diamond with C as the filling character and N side length, and output a new line character after each diamond.
###Input example:
Here is a set of inputs. For example:
```in
A 5 B 3
```
###Output example:
The corresponding output is given here. For example:
```out
A
AAA
AAAAA
AAAAAAA
AAAAAAAAA
AAAAAAA
AAAAA
AAA
A
B
BBB
BBBBB
BBB
B
```
Note: it is suggested to use C + + CIN to process the input data







answer:If there is no answer, please comment