1
1
Fork 0

Simplified the solution for 'Summary 1 ex 8'

as suggested in https://github.com/BruceEckel/AtomicKotlinExamples/issues/19
This commit is contained in:
Svetlana Isakova 2021-07-20 17:13:07 +02:00
parent 1a891f4a41
commit 96e21f6122
2 changed files with 2 additions and 4 deletions

View File

@ -6,11 +6,9 @@ fun reverseDecimal(number: Int): Int {
var result = 0 var result = 0
while (worker > 0) { while (worker > 0) {
result *= 10
result += worker % 10 result += worker % 10
worker /= 10 worker /= 10
if (worker != 0) {
result *= 10
}
} }
return result return result
} }

View File

@ -4,7 +4,7 @@ files:
visible: true visible: true
placeholders: placeholders:
- offset: 89 - offset: 89
length: 171 length: 140
placeholder_text: TODO() placeholder_text: TODO()
- name: test/Tests.kt - name: test/Tests.kt
visible: false visible: false