📄 d10r2.cpp
字号:
#include <process.h>
#include <math.h>
#include <iomanip.h>
#include <iostream.h>
double fun(double x)
{
double t;
t=bessj0( x);
return t;
}
void main()
{
//program d10r2
//driver for routine zbrac
bool succes;
int i;
double x1,x2;
cout<<endl;
cout<<" bracketing values: function values:"<<endl;
cout<<endl;
cout<<" x1 x2 bessj0(x1) bessj0(x2)";
cout<<setprecision(2)<<setiosflags(ios::fixed);
for (i = 1; i<=10; i++)
{
x1 = double(i);
x2 = x1 + 1;
zbrac(x1, x2, succes);
if (succes)
{
cout<<setprecision(2)<<setw(8)<<x1;
cout<<setprecision(2)<<setw(8)<<x2;
cout<<setprecision(6)<<setw(14)<<bessj0(x1);
cout<<setprecision(6)<<setw(14)<<bessj0(x2);
}
}
cout<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -