#include <iostream>
#include <conio.h>
#include <time.h>
#include "CalMethod.h"
using namespace std;
int main()
{
char ch;
double now;
cout<<"*******************************************************************************"<<endl;
cout<<" Ln��x�� Calculator "<<endl;
cout<<"*******************************************************************************"<<endl;
do
{
LongFloat num, ans;
char str[MAXSIZE];
cout<<"x = ";
cin>>str;
num.Save(str);
if( num.NotPositive()==true )
{
cout<<"Unreasonable x. Please input x AGAIN."<<endl;
continue;
}
cout<<"1. Solve by using Taylor Series Method"<<endl;
now=clock();
ans=Taylor1(num);
ans.Output();
cout<<" Time: "<<(double)((clock()-now)/CLOCKS_PER_SEC)<<"s"<<endl;
now=clock();
cout<<"2. Solve by using Improved Taylor Series Method"<<endl;
ans=Taylor2(num);
ans.Output();
cout<<" Time: "<<(double)((clock()-now)/CLOCKS_PER_SEC)<<"s"<<endl;
now=clock();
cout<<"3. Solve by using Romberg Method"<<endl;
ans=Romberg(num);
ans.Output();
cout<<" Time: "<<(double)((clock()-now)/CLOCKS_PER_SEC)<<"s"<<endl;
now=clock();
cout<<"4. Solve by using Runge-Kutta Method"<<endl;
ans=RungeKutta(num);
ans.Output();
cout<<" Time: "<<(double)((clock()-now)/CLOCKS_PER_SEC)<<"s"<<endl;
cout<<endl<<"Press 'Q' to quit, other keys to continue."<<endl;
ch=getch();
cout<<endl;
} while (ch!='Q' && ch!='q');
return 0;
}
lnx的几种C语言求解方法对比
5星 · 超过95%的资源 需积分: 50 136 浏览量
2013-05-24
23:06:59
上传
评论 4
收藏 3KB ZIP 举报
flyskyyuan
- 粉丝: 1
- 资源: 1
最新资源
- Wireshark-4.2.4-x64.zip
- 2022年11月软件设计师上
- 基于VB+ACCESS教学管理系统(参考文献+源代码).zip
- 一个工具的流程图 demo
- EMC3080的用于连接FogCloud的固件
- 基于VB+Access酒店客房管理系统(源代码+参考文献+报告).zip
- 应用笔记LAT1244+奇怪的NRST+管脚异常复位问题
- SEMI标准的解释说明
- tensorflow-2.8.2-cp37-cp37m-manylinux2010-x86-64.whl
- tensorflow-rocm-2.12.0.560-cp311-cp311-manylinux2014-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈