Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by Irmusik ( 16 years ago )
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL,"rus");
int n,k;
double xn, xk, dx, e,sum,x,fn,fact;
cout<<"введите начальное значение";
cin>>xn;
cout<<"введите конечное значение";
cin>>xk;
cout<<"введите шаг";
cin>>dx;
cout<<"введите точность";
cin>>e;
for (x=xn;x<=xk;x=x+dx)
sum=1;
fn=1;
fact=1;
n=0;
while (fn>=e)
{
n=n+1;
fact=fact*n;
fn=(pow(-1,n)*pow(x,2*n))/2*fact;
}
k=n;
cout<<x<<k<<sum<<endl;
return 0;
}
Revise this Paste
Children: 16900