반응형
fun main(args: Array<String>) {
val (a, b) = readLine()!!.split(' ').map(String::toInt)
println("a = $a")
println("b = $b")
}
https://postiveemblem.tistory.com/164
[Kotlin][5]코틀린 readline()과 자료형 변환 방법
안녕하세요. 오늘은 저번 타이머 함수 사용법에 이어서 readline()을 이용해 사용자에게 입력받는 법을 알아보려고 합니다. 또 입력 받은 모든 값을 스트링 값으로 반환하는 readline()을 어떻게 하면
postiveemblem.tistory.com
반응형
'IT > 알고리즘' 카테고리의 다른 글
81 프로그머스] Kotlin 대소문자 바꿔서 출력하기 (0) | 2023.10.08 |
---|---|
80] 프로그래머스 문자열 반복해서 출력하기 (0) | 2023.10.08 |
78] 1672. Richest Customer Wealth Kotlin (0) | 2023.04.19 |
77] Leetcode 1979. Find Greatest Common Divisor of Array #Kotlin (0) | 2023.04.12 |
76] ★ Leetcode 1071. Greatest Common Divisor of Strings Kotlin (0) | 2023.04.11 |
댓글