From a8cbadbe7d0c0fef9fec7c981af1aa5e53ff9925 Mon Sep 17 00:00:00 2001 From: Rhinemann Date: Sun, 7 May 2023 23:15:50 +0300 Subject: [PATCH] Added a Kotlin variation. --- Java/lab_1/lab_1.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Java/lab_1/lab_1.kt b/Java/lab_1/lab_1.kt index 38039eb..48a2ef6 100644 --- a/Java/lab_1/lab_1.kt +++ b/Java/lab_1/lab_1.kt @@ -1,10 +1,10 @@ fun protectedInput(variableName: String): Int { do { try { - print("Enter $variableName: "); + print("Enter $variableName: ") return readln().toInt() } catch (e: Exception) { - println("${variableName.uppercase()} must be an integer!"); + println("${variableName.uppercase()} must be an integer!") } } while (true) }