summaryrefslogtreecommitdiff
path: root/math/binomial.cpp
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2023-02-23 18:16:53 +0100
committermzuenni <michi.zuendorf@gmail.com>2023-02-23 18:16:53 +0100
commit63a38d41b3c2b50429d4af7b3cdffdcdd915e3b7 (patch)
treed0b22cd723643d401ae91812f33cebb37a7e7e72 /math/binomial.cpp
parentb40b4fbc8222226608c64013e56226044884374e (diff)
added more ctalan stuff
Diffstat (limited to 'math/binomial.cpp')
-rw-r--r--math/binomial.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/math/binomial.cpp b/math/binomial.cpp
index fc6d980..02b27e3 100644
--- a/math/binomial.cpp
+++ b/math/binomial.cpp
@@ -1,8 +1,7 @@
ll calc_binom(ll n, ll k) {
- ll r = 1, d;
if (k > n) return 0;
- // Reihenfolge garantiert Teilbarkeit
- for (d = 1; d <= k; d++) {
+ ll r = 1;
+ for (ll d = 1; d <= k; d++) {// Reihenfolge => Teilbarkeit
r *= n--;
r /= d;
}