//Ex5_13.cpp
#include "iostream" 
#include "cmath" 
using namespace std;
double s(double x,double eps=1e-6)  //参数eps带有缺省值 
{int n=1; 
 double w=0.0,t=1.0 ; 
 while(fabs(t)>=eps) 
	{w+=t;t=t*x/(n++);}  
 return w; 
} 
void main() 
{cout<<"e1="<<s(1.0)<<endl;       //eps取缺省值1e-6 
 cout<<"e2="<<s(1.0,1e-4)<<endl;  //eps值取1e-4
}
