반응형

프로그래밍 언어/코틀린(Kotline) 5

[Kotlin] Day 3: Intro to Conditional Statements (HackerRank - 30 Days of Code)

Objective In this challenge, we learn about conditional statements. Check out the Tutorial tab for learning materials and an instructional video. Task Given an integer, , perform the following conditional actions: If is odd, print Weird If is even and in the inclusive range of to , print Not Weird If is even and in the inclusive range of to , print Weird If is even and greater than , print Not W..

[Kotlin] Day 2: Opterators (HackerRank - 30 Days of Code)

Objective In this challenge, you will work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video. Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost. Round the resu..

[Kotlin] Day 0: Hello, World. (HackerRank - 30 Days of Code)

Objective In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video! Task To complete this challenge, you must save a line of input from stdin to a variable, print Hell..

코틀린(Kotlin) 진법 변환 .toInt()

문자열 -> N진법 변환 코틀린에서 문자열을 N진법으로 변환하는 방법은 .toInt() 함수를 사용하는 방법이 있습니다. 코틀린 라이브러리를 확인해 보면 코틀린 1.1 버전부터 사용이 가능하며, 내부적으로는 자바의 .parseInt() 함수를 사용하고 있습니다. /** * Parses the string as an [Int] number and returns the result. * @throws NumberFormatException if the string is not a valid representation of a number. * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conve..

반응형