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

PROGRAMMING:Draw diamonds with Obama

Luz5年前 (2021-05-10)题库512
U.S. President Barack Obama not only called on everyone to learn programming, but also set an example to write code, becoming the first president in the history of the United States to write computer code. At the end of 2014, to celebrate the official launch of "Computer Science Education Week", Obama wrote a very simple computer code: draw a square on the screen. Now you can draw with him!
###Input format:
Enter the length of the square side $$n $$($$3 / Le n / Le 21 $$) and the character 'C' that makes up the side of the square in one line, one space apart.
###Output format:
Outputs the square drawn by the given character 'C'. But notice that the row spacing is larger than the column spacing, so in order to make the result look more like a square, the number of rows we output is actually 50% of the number of columns (rounded).
###Input example:
```in
10 a
```
###Output example:
```out
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
```






answer:If there is no answer, please comment