?? 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 + -