From 03751048d9aadacab985c354562da71244d3549b Mon Sep 17 00:00:00 2001 From: b1urrrr Date: Thu, 16 Nov 2023 19:25:52 +0900 Subject: [PATCH] =?UTF-8?q?[ADD/#1]=20=EC=BD=94=ED=8B=80=EB=A6=B0=20?= =?UTF-8?q?=ED=82=A4=EB=B3=B4=EB=93=9C=20=EC=9E=85=EB=A0=A5=20=EC=8B=A4?= =?UTF-8?q?=EC=8A=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/src/main/java/com/ocomwan/kotlinbasics/Main.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/WEEK01/app/src/main/java/com/ocomwan/kotlinbasics/Main.kt b/WEEK01/app/src/main/java/com/ocomwan/kotlinbasics/Main.kt index a7c792d..6fe6bf5 100644 --- a/WEEK01/app/src/main/java/com/ocomwan/kotlinbasics/Main.kt +++ b/WEEK01/app/src/main/java/com/ocomwan/kotlinbasics/Main.kt @@ -1,8 +1,10 @@ package com.ocomwan.kotlinbasics +import java.util.Scanner import kotlin.random.Random fun main() { + // Random var randomNumber = Random.nextInt() print(randomNumber) @@ -11,4 +13,12 @@ fun main() { val randomDouble = Random.nextDouble(0.0, 1.0) // 0.0 ~ 0.9999... print(randomDouble) + + // 키보드 입력 + val reader = Scanner(System.`in`) + + val numberInput = reader.nextInt() + println(numberInput) + val stringInput = reader.next() + println(stringInput) }