📄 test.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 + -