?? d10r5.cpp
字號:
#include <process.h>
#include <math.h>
#include <iomanip.h>
#include <iostream.h>
double func(double x)
{
double t;
t=bessj0( x);
return t;
}
void main()
{
//program d10r5
//driver for routine rtflsp
int n,nbmax,nb,i;
double x1,x2,xacc,root,xb1[20], xb2[20];
n = 100;
nbmax = 20;
x1 = 1.0;
x2 = 50.0;
nb = nbmax;
zbrak(x1, x2, n, xb1, xb2, nb);
cout<<endl;
cout<<"Roots of Bessj0:"<<endl;
cout<<endl;
cout<< " x f(x)"<<endl;
for (i = 1; i<=nb; i++)
{
xacc = (0.0000010) * (xb1[i] + xb2[i]) / 2.0;
root = rtflsp(xb1[i], xb2[i], xacc);
cout<< setw(6)<<"root "<<i;
cout<< setw(12)<<root;
cout<< setw(18)<<bessj0(root)<<endl;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -