⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 degree.cpp

📁 This library defines basic operation on polynomials, and contains also 3 different roots (zeroes)-fi
💻 CPP
字号:
// degree.cpp : Shows use of degree()
//
#include <iostream>
#include <polynomial.h>

using namespace std;

int main() {

    // Initialize p(x) = 5x^4 + 3x^2 + x + 10
    Polynomial<double> p(4, 10., 1., 3., 0., 5.);

    // Initialize q(x) = x^3 + x^2 - 5x + 2
    Polynomial<double> q(3, 2., -5., 1., 1.);

    //  Add p and q
    Polynomial<double> r = p + r;

    //  Display degree of new polynomial
    cout << "degree of r(x): " << r.degree() << endl;

    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -