Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified out/production/KotlinSprint/META-INF/KotlinSprint.kotlin_module
Binary file not shown.
9 changes: 9 additions & 0 deletions src/main/kotlin/lesson_1/lesson1_task5.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package lesson_1

fun main() {
val seconds: Short = 5409

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

что-то маловато секунд, обычно пишут 106 минут (6360) - или это открытый космос? )

val hours: Int = seconds / 3600
val minuts: Int = (seconds - hours * 3600) / 60
val remainsSeconds = seconds - hours * 3600 - minuts * 60
println("0$hours:$minuts:0$remainsSeconds")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в данном случае вывод будет корректный, но данный println не универсальный.
Давай применим "%02d...".format(...)

}