HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50463 - Drawing a Triangle

Guest
• Review clarifications (4)

Section problems

• 50798 - Passing the course
• 50799 - OSHEE Electric Bill
• 50833 - Min of Odd Positions
• 50821 - Derivative of an array
• 50808 - Total Distance Traveled
• 50452 - Multiplication Table
• 50456 - nth Digit of a Number
• 50817 - The Knight Move
• 50463 - Drawing a Triangle
• 50537 - esreveR Triangle
• 50385 - From m to n
• 50966 - TVSH
• 503013 - DNA
• 50970 - Marbles
• 50943 - Word Game
• 50971 - Belote Game
• 50942 - Win or Lose

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.
Question by Ibrahim Mesecan.

Drawing a Triangle

Question:
Write a program that gets a number n then, draws a triangle using the given char with the size n.

Input specification
You will be given a number (n) and a character ch where n is the height of the triangle.
Then

  • in the first line of the triangle, you will have just one char
  • in the second line of the triangle, you will have two chars, separated by a space
  • in the nth line of the triangle, you will have n chars, separated by spaces
where 0 ≤ n ≤ 30.

Output specification
Show a triangle from the given char (and every char is followed by a space char).

Sample Input I   
4 c

Sample Input II   
6 x
Sample Output I   
c
c c
c c c
c c c c
Sample Output II  
x
x x
x x x
x x x x
x x x x x
x x x x x x


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

www.contester.ru