?? d10r4.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 d10r4
//driver for routine rtbis
int n,nbmax,nb,i;
double xb1[21], xb2[21],xacc,x1,x2,root;
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.000001) * (xb1[i] + xb2[i]) / 2.0;
root = rtbis(xb1[i], xb2[i], xacc);
cout<< setw(8)<< " root"<<i;
cout<< setw(12)<<root;
cout<< setw(18)<<bessj0(root)<<endl;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -