?? d5r3.cpp
字號(hào):
#include "iostream.h"
#include "math.h"
void main()
{
//program d5r3
//driver for routine poldiv
int i,n = 6;
int nv = 4;
double u[7], v[5], q[7], r[7];
u[1] = -1.0;
u[2] = 5.0;
u[3] = -10.0;
u[4] = 10.0;
u[5] = -5.0;
u[6] = 1.0;
v[1] = 1.0;
v[2] = 3.0;
v[3] = 3.0;
v[4] = 1.0;
poldiv(u, n, v, nv, q, r);
cout.setf(ios::fixed|ios::right);
cout.precision(2);
cout<<endl;
cout<<" x^0 x^1 x^2 x^3 x^4 x^5"<<endl;
cout<<"Quotient polynomial coefficients:"<<endl;
for (i = 1; i<=n; i++)
{
cout.width(10);
cout<<q[i];
}
cout<< endl;
cout<<"Expected quotient coefficients:"<<endl;
cout<<" 31.00 -8.00 1.00 0.00 0.00 0.00"<<endl;
cout<<"Remainder polynomial coefficients:"<<endl;
for (i = 1; i<=nv; i++)
{
cout.width(10);
cout<<r[i];
}
cout<<endl;
cout<<"Expected quotient coefficients:"<<endl;
cout<<" -32.00 -80.00 -80.00 0.00"<<endl;;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -