📄 d10r3.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 d10r3
//driver for routine zbrak
int n,nbmax,i,nb;
double x1,x2;
n = 100;
nbmax = 20;
x1 = 1.0;
x2 = 50.0;
double xb1[20], xb2[20];
nb = nbmax;
zbrak(x1, x2, n, xb1, xb2, nb);
cout<<endl;
cout<<setprecision(4)<<setiosflags(ios::fixed);
cout<<"Brackets for roots of Bessj0:"<<endl;
cout<<endl;
cout<<" lower upper f(lower) f(upper)"<<endl;
for (i = 1; i<=nb; i++)
{
cout<< "root"<<" "<<i;
cout<< setw(12)<<xb1[i];
cout<< setw(12)<<xb2[i];
cout<< setw(12)<<bessj0(xb1[i]);
cout<< setw(12)<<bessj0(xb2[i])<<endl;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -