pqc/external/flint-2.4.3/examples/partitions.cpp
2014-05-24 23:16:06 +02:00

25 lines
401 B
C++

#include <cstdlib>
#include <iostream>
#include "arithxx.h"
#include "fmpzxx.h"
using namespace flint;
using namespace std;
int
main(int argc, char * argv[])
{
if (argc != 2)
{
std::cerr << "usage: partitions n\n";
return 1;
}
ulong n;
flint_sscanf(argv[1], "%wu", &n);
std::cout << "p(" << n << ") =\n" << number_of_partitions(n) << '\n';
return 0;
}