股东注资模式:指数函数1

来源:百度文库 编辑:九乡新闻网 时间:2024/05/01 17:36:15
#include
using namespace std;
const double ERROR=0.00001;
float exp(float);
void main()
{
 float x,y;
 cin>>x;
 y=exp(x);
 cout<}
float exp(float x)
{
 int i;
 float f,m,y;
 f=1;
 m=1;
 y=1;
 i=1;
 while(m/f>ERROR)
 {
  f=f*i;
  m=m*x;
  y=y+m/f;
  i=i+1;
 }
 return y;
}