#K34827. Diamond Pattern Printer
Diamond Pattern Printer
Diamond Pattern Printer
In this problem, you are required to print a diamond pattern made up of asterisks ('*'). The diamond will have a total of (2n-1) rows, and each row will consist of exactly (2n-1) characters. The pattern is symmetric: the first (n) rows form the upper half of the diamond, and the remaining rows form the lower half.
For example, when (n=3), the output should be:
* *** ***** *** *
Your program should read an integer (n) from standard input, and then print the diamond pattern to standard output. Make sure that the alignment and spacing closely match the specified pattern.
inputFormat
The input consists of a single integer (n) ((1 \le n \le 50)), which denotes the size parameter for the diamond pattern. The integer is read from standard input.
outputFormat
Output the diamond pattern to standard output. The diamond pattern should have exactly (2n-1) rows, and each row must consist of exactly (2n-1) characters (including spaces).## sample
1
*
</p>