Skip to content

Learning path · Programming Foundations with Python

Back to lesson · Loops

수 삼각형 출력하기 (반복 구조)

Unrated
한국어

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
5
Correct
2
Solved by
2
AC rate
40.000%

Statement

높이가 $k$인 수 삼각형을 출력하는 함수 g(k)를 반복 구조를 사용하여 설계하시오. 수 삼각형의 $i$번째 줄에는 1부터 $i$까지의 정수를 공백을 사이에 두고 출력한다.

Input

첫째 줄에 정수 $k$가 주어진다. ($1 \le k \le 100$)

Output

$k$개의 줄에 걸쳐 수 삼각형을 출력한다.

Examples

Sample input 1
4
Sample output 1
1
1 2
1 2 3
1 2 3 4
Sample input 2
1
Sample output 2
1

Tags

No tags yet