d11r1.cpp

来自「工程算法 这是一个很有用的工程数值算法集锦」· C++ 代码 · 共 33 行

CPP
33
字号
#include "iostream.h"
#include "math.h"

double func(double x)
{
    return bessj0(x);
}

void main()
{
    //program d11r1
    //driver for routine mnbrak
	double ax,bx,cx,fa,fb,fc;
	cout.setf(ios::fixed);
	cout.precision(6);
    for (int i = 1; i<=10; i++)
	{
        ax = i * 0.5;
        bx = (i + 1) * 0.5;
        mnbrak(ax, bx, cx, fa, fb, fc);
        cout<<"        a           b            c"<<endl;
        cout<<"x";
		cout.width(12);        cout<<ax;
		cout.width(12);        cout<<bx;
		cout.width(12);        cout<<cx<<endl;
        cout<<"f";	   
		cout.width(12);        cout<<fa;
		cout.width(12);        cout<<fb;
		cout.width(12);        cout<<fc;
		cout<<endl;
    }
} 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?