-
[백준 2741][Swift] 기찍 N알고리즘 2022. 3. 31. 20:58728x90
코드
let input = Int(readLine()!)! for i in 0..<input { print(input - i) }
https://www.acmicpc.net/problem/2742
2742번: 기찍 N
자연수 N이 주어졌을 때, N부터 1까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오.
www.acmicpc.net
'알고리즘' 카테고리의 다른 글
[백준 1924][Swift] 2007년 (0) 2022.04.01 [백준 2739][Swift] 구구단 (0) 2022.04.01 [백준 2741][Swift] N 찍기 (0) 2022.03.31 [백준 11721][Swift] 열 개씩 끊어 출력하기 (0) 2022.03.31 [백준 11720][Swift] 숫자의 합 (0) 2022.03.31