[프로그래머스 LV0] 직각삼각형 출력하기

jonghwan·2022년 10월 26일
0

프로그래머스

목록 보기
44/71
post-thumbnail

1. 문제 설명

직각삼각형 출력하기

2. 문제 분석

1부터 n만큼 반복하면서 별을 출력해준다.

3. 나의 풀이

import Foundation

let n = Int(readLine()!)!

for i in 1...n {
    print(String(repeating: "*", count: i))
}

0개의 댓글