September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,6 +1,6 @@
fun facti(n: Int) = when {
n < 0 -> throw IllegalArgumentException("negative numbers not allowed")
else -> {
else -> {
var ans = 1L
for (i in 2..n) ans *= i
ans
@ -10,7 +10,7 @@ fun facti(n: Int) = when {
fun factr(n: Int): Long = when {
n < 0 -> throw IllegalArgumentException("negative numbers not allowed")
n < 2 -> 1L
else -> n * factr(n - 1)
else -> n * factr(n - 1)
}
fun main(args: Array<String>) {