求实数的渐进分数
include
include
using namespace std;
double quzheng(double x) //定義一種取整函數
{
double t;
if(x>0)
{
t=floor(x+0.5);
}
if(x<=0)
{
t=-floor(fabs(x)+0.5);
}
return t;
}
int main()
{
double n,m,p; //定義漸進分數的循環序列和實數
cout<<”請輸入一個實數:”;
cin>>n;
m=floor(n); //取整
double x=n;
double a0=1,b0=0,a1=m,b1=1,a,b;
cout<<”漸進分數為:”<
總結
- 上一篇: 【趋势分析】EXPMA四色均线指标优化版
- 下一篇: Android基础入门教程——7.5.4