美文网首页
c++调用ntl数论库

c++调用ntl数论库

作者: 一路向后 | 来源:发表于2023-04-15 17:39 被阅读0次

1.源码实现

#include <NTL/ZZ.h>

NTL_CLIENT

int main()
{
        ZZ a, b, c;

        cin >> a;
        cin >> b;

        c = a+b;

        cout << c << endl;

        return 0;
}

2.编译源码

$ g++ -o test test.cpp -std=c++11 -L/usr/local/lib -lntl -lpthread -lgmp

3.运行及其结果

$ ./test
12
23
35

相关文章

网友评论

      本文标题:c++调用ntl数论库

      本文链接:https://www.haomeiwen.com/subject/tcmxjdtx.html