C++ Library Extensions
2022.12.09
To help learn modern C++ programming
000-permutation.cpp
Go to the documentation of this file.
1
#include <
tpf_ncrnpr.hpp
>
2
#include <
tpf_output.hpp
>
3
4
void
examples_for_permutations
()
5
{
6
using namespace
tpf::ncrnpr
;
7
using namespace
tpf::output
;
8
9
tpf::console
cout
;
10
auto
nl
=
tpf::output::nl
();
11
12
using
m_th_t =
tpf::ncrnpr::permutation::number_t
;
13
14
m_th_t n;
15
cout
<<
"input n: "
; std::cin >> n;
16
17
auto
n_p_r =
npr
(n, n);
18
19
cout
<<
"Computing ... "
<< n_p_r <<
" permutations!"
<<
nl
;
20
for
(m_th_t i = 0; i <= n_p_r; ++i)
21
{
22
23
// enum_permutation((m_th_t)12, (m_th_t)12, i);
24
}
25
26
cout
<<
"Done..."
<<
nl
;
27
28
}
29
30
int
main
()
31
{
32
examples_for_permutations
();
33
}
examples_for_permutations
void examples_for_permutations()
Definition:
000-permutation.cpp:4
main
int main()
Definition:
000-permutation.cpp:30
nl
auto nl
Definition:
017-expression-fold.cpp:4
cout
auto & cout
Definition:
044-functional.cpp:3
tpf::ncrnpr::permutation::number_t
big_unsigned_t number_t
Definition:
tpf_ncrnpr.hpp:1224
tpf::ncrnpr
Implements nCr, nPr.
Definition:
tpf_ncrnpr.hpp:64
tpf::ncrnpr::npr
enable_if_all_in_list_t< types::type_list_t< Type1, Type2 >, integral_list_t, ReturnType > npr(Type1 nn, Type2 rr)
Definition:
tpf_ncrnpr.hpp:428
tpf::output
Stream output operators are defined.
Definition:
tpf_output.hpp:58
tpf::output::nl
constexpr new_line nl()
Definition:
tpf_output.hpp:837
tpf_ncrnpr.hpp
tpf_output.hpp
Stream output operators << are implemented.
CppExtension
examples
000-permutation.cpp
Generated by
1.9.4