HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50148 - esreveR Triangle

Section problems

• 50096 - Dajte Express
• 50098 - Cryptography
• 50099 - Snake
• 50100 - The biggest result
• 50113 - Letter Grades
• 50124 - Falling Bricks
• 50135 - Lines
• 50140 - Ordering Pizza
• 50148 - esreveR Triangle
• 50193 - Passing the course
• 50194 - OSHEE Electric Bill
• 50199 - Total Distance Traveled
• 50200 - Print Office
• 50204 - Post Office
• 50205 - Secret Number
• 50207 - Parking Place
• 50217 - Exchange the Values

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.

esreveR Triangle

Draw a reverse triangle with the given size (n) and given chars. When drawing the triangle, at the beginning of everyline, give some space, such that

  • the first line will have n-1 space and then 1 char
  • the second line will have n-2 spaces and then 2 chars
  • the third line will have n-3 spaces and then 3 chars
  • etc.
Then, every line starts with the first char and it's followed by the second, and so on.

Question: Write a program, that is going to take the size of triangle and two chars. And draw the described triangle.

Input specification
You will be given one integer (n) and two chars 0 ≤ n ≤ 100. The chars are 26 uppercase or lowercase English characters.

Output specification
Draw the described triable.

Sample Input I
5 b n
Sample Input II
7 x t

Sample Output I
    b
   bn
  bnb
 bnbn
bnbnb
Sample Output II
      x
     xt
    xtx
   xtxt
  xtxtx
 xtxtxt
xtxtxtx



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

www.contester.ru