[BOJ 7595] Triangles

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 128M

Problem type
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

It is not hard to draw a triangle of stars of any given size. For example, a size 5 triangle would look like this (5 stars high and 5 stars wide):</p>




*

Your task is to draw triangles in a number of sizes. 

입력 형식

Each line of input contains a single positive integer, n, 1 <= n <= 100. The last line of input contains 0. For each non-zero number, draw a triangle of that size. 

출력 형식

Output consists of triangles of the appropriate sizes. Each triangle is wider at the bottom. There are no gaps between the triangles. 

예제 입력

5
3
2
7
0

예제 출력

*
**
***
****
*****
*
**
***
*
**
*
**
***
****
*****
******
*******

Comments

There are no comments at the moment.