HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


044. 50597 - Drawing Diamonds

Guest
• Review clarifications (1)

Volume problems

• 020. 50485 - Center of gravity of a ...
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50487 - Radius of Inscribed Circle
• 027. 50548 - Albanian Airlines
• 028. 50483 - Group Total
• 033. 50588 - Processing the list of n...
• 035. 50573 - Count and Sum
• 044. 50597 - Drawing Diamonds
• 058. 50574 - Triangular Numbers
• 072. 50473 - Counting Circles Positions
• 118. 50514 - Bookkeeping
• 125. 50484 - Number Of Letters
• 132. 50504 - School contest
• 136. 50443 - Dajte Express
• 147. 50553 - Divisible by m
• 148. 50596 - Your Ride Is Here (US...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Drawing Diamonds

Shqip

You are going to be given a number and a char. Write a program that draws a diamond with the given size and char.

Input specification
You will be given an integer n (where 1 ≤ n < 100), and a char from ASCII table.
Note: For convenience, n will be an odd number.

Output specification
Draw a diamond using the given character and size. When drawing it, the height of the diamond (the number of lines) will be equal to the given number n.

At the beginning of every line (except the mid line), there will be some space. The number of spaces at the beginning of every line will first decrease, after the mid line, it will increase again. Pay attention that the number of characters on every line changes, too.


Sample Input 1
7 #
Sample Output 1
   #
  # #
 # # #
# # # #
 # # #
  # #
   #

Sample Input 2
5 *
Sample Output 2
  *
 * *
* * *
 * *
  *


Для отправки решений необходимо выполнить вход.

www.contester.ru