Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,18 @@
fun pas(rows: Int) {
for (i in 0..rows - 1) {
for (j in 0..i)
print(ncr(i, j).toString() + " ")
println()
}
}
fun ncr(n: Int, r: Int) = fact(n) / (fact(r) * fact(n - r))
fun fact(n: Int) : Long {
var ans = 1.toLong()
for (i in 2..n)
ans *= i
return ans
}
fun main(args: Array<String>) = pas(args[0].toInt())