Skip to content

Commit

Permalink
[ADD/#1] 코틀린 난수 발생 생성 실습
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Nov 15, 2023
1 parent 9af9b53 commit 926dc59
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions WEEK01/app/src/main/java/com/ocomwan/kotlinbasics/Main.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.ocomwan.kotlinbasics

import kotlin.math.max
import kotlin.math.min

const val num = 20
import kotlin.random.Random

fun main() {
val i = 10
val j = 20
var randomNumber = Random.nextInt()
print(randomNumber)

randomNumber = Random.nextInt(0, 100) // 0 ~ 99
print(randomNumber)

print(max(i, j))
print(min(i, j))
val randomDouble = Random.nextDouble(0.0, 1.0) // 0.0 ~ 0.9999...
print(randomDouble)
}

0 comments on commit 926dc59

Please sign in to comment.