File: partitions.cpp

package info (click to toggle)
flint 2.5.2-19
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 30,308 kB
  • sloc: ansic: 289,367; cpp: 11,210; python: 1,280; sh: 649; makefile: 283
file content (24 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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;
}