
원문: https://velog.io/@newon-seoul/Swift-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98-%EC%9E%85%EB%A0%A5%EB%B0%9B%EA%B8%B0 Swift 알고리즘 입력받기 입력받기 기본형태 정수로 입력받기 공백문자를 기준으로 띄워서 Array 으로 받기 공백문자를 기준으로 띄워서 Array 으로 받기 한 줄 정수를 Array 로 입력받기 공백문자를 기준으로 띄워서 이차원 velog.io 🔥 원문에 정리를 참고하여 공부하면서 다시 정리해본다. 입력받기 기본 형태(readLine()!) let input = readLine() print("출력 = \(input), 타입 = \(type(of: input))") // 입력 : 10 // 출력 : O..

해당 내용을 알게 된 문제 https://www.acmicpc.net/problem/25083 25083번: 새싹 아래 예제와 같이 새싹을 출력하시오. www.acmicpc.net ✅ 특수 문자열 출력하는 방법! 1️⃣ 역슬래쉬를(\) 출력하려면 print 문에 역슬래쉬(\)를 2번 작성해야 한다. print(" ,r'\"7") print("r`-_ ,' ,/") print(" \\. \". L_r'") print(" `~\\/") print(" |") print(" |") ✅ 역슬래쉬와 큰 따옴표를 출력하기 위해 앞에 역슬래쉬 ( \ )를 붙인 코드 2️⃣ 큰따옴표(")를 출력하려면 print 문에 역슬래쉬(\) + 큰따옴표(")를 작성해야 한다. print(""" ,r'\"7 r`-_ ,' ,/ \\..

Component 공식 문서: https://developer.apple.com/documentation/foundation/nsstring/1413214-components components(separatedBy:) | Apple Developer Documentation Returns an array containing substrings from the receiver that have been divided by a given separator. developer.apple.com func components(separatedBy separator: String) -> [String] 파라미터의 개수 - components 메서드의 경우는 매개변수가 separatedBy 하나만 있고 매개변수로 ..

reversed() 공식 문서: https://developer.apple.com/documentation/foundation/data/1780245-reversed/ reversed() | Apple Developer Documentation Returns a view presenting the elements of the collection in reverse order. developer.apple.com - 컬렉션의 요소를 역순으로 나타내는 뷰를 반환한다. func reversed() -> ReversedCollection - 컬렉션의 순서를 뒤집을 때 사용한다. - String 문자열도 배열이고 배열은 컬렉션이므로 뒤집을 수 있다! - 리턴타입이 ReversedCollection 이므로, 필요에..