⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 数值计算方法中的,牛顿向前和向后算法. 以前花了很长时间编写的,希望对后来的师妹师弟有用.
💻 CPP
字号:
#include "iostream.h"

#include "NewtonFor.h"
#include "NewtonBack.h"

int main(void)
{
 NewtonFor nf;
 NewtonBack nb;
 float x[]={0,1,2,3};
 float y[]={1,3,5,12};
 float xx;

 nf.SetData(x,y,4);
 nf.CreateTable();

 nb.SetData(x,y,4);
 nb.CreateTable();

 cout<<"please enter the x value"<<endl;
 cin>>xx;
 cout<<"the result of NewtonForward is "<<nf.Cal(xx)<<endl;
 cout<<"the error of NewtonForward is "<<nf.Cal_Error(xx)<<endl;
 cout<<"the result of NewtonBackWard is "<<nb.Cal(xx)<<endl;
 cout<<"the error of NewtonBACKward is "<<nb.Cal_Error(xx)<<endl;
 return 0;
}

⌨️ 快捷键说明

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