diff options
Diffstat (limited to 'math')
| -rw-r--r-- | math/binomial.cpp | 14 | ||||
| -rw-r--r-- | math/math.tex | 4 |
2 files changed, 7 insertions, 11 deletions
diff --git a/math/binomial.cpp b/math/binomial.cpp index afc9800..61d9d69 100644 --- a/math/binomial.cpp +++ b/math/binomial.cpp @@ -1,15 +1,7 @@ -#include <iostream> - -using namespace std; - - -unsigned long long calc_binom(unsigned long long N, unsigned long long K) -{ - unsigned long long r = 1; - unsigned long long d; +ll calc_binom(ll N, ll K) { + ll r = 1, d; if (K > N) return 0; - for (d = 1; d <= K; d++) - { + for (d = 1; d <= K; d++) { r *= N--; r /= d; } diff --git a/math/math.tex b/math/math.tex new file mode 100644 index 0000000..e1e0950 --- /dev/null +++ b/math/math.tex @@ -0,0 +1,4 @@ +\section{Mathe} + +\subsection{Binomialkoeffizienten} +\lstinputlisting{math/binomial.cpp}
\ No newline at end of file |
