From c14a31cef0c8a1c80c74938a3a36d8d2b54325f6 Mon Sep 17 00:00:00 2001 From: Anv0l Date: Mon, 17 Feb 2025 22:54:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20fizzbuzz=20=D0=B8=20sumoftwo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 7 ++++--- src/main/kotlin/ru/otus/homework/fizzbuzz.kt | 15 ++++++++++++++- src/main/kotlin/ru/otus/homework/sumoftwo.kt | 7 ++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index f4ad580..123fd3c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,13 +3,13 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } kotlin { jvmToolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(21) } } @@ -27,4 +27,5 @@ repositories { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation 'org.junit.jupiter:junit-jupiter:5.8.1' + } \ No newline at end of file diff --git a/src/main/kotlin/ru/otus/homework/fizzbuzz.kt b/src/main/kotlin/ru/otus/homework/fizzbuzz.kt index 6e04be1..04d465e 100644 --- a/src/main/kotlin/ru/otus/homework/fizzbuzz.kt +++ b/src/main/kotlin/ru/otus/homework/fizzbuzz.kt @@ -2,5 +2,18 @@ package ru.otus.homework fun fizzbuzz(n: Int): Array { - TODO("Выполните задание") + val result: Array = Array(n) { "" } + + for (i in 0..