double func(double X, double epsilon)
{
double r = 0, r1=0;
r+=pow(X,1)/fact(1);
r1=r + pow(-1,2.0)*pow(X,3)/fact(3);
for(double n=0;fabs(r-r1)>epsilon;n++)
{
r+=pow(-1,n)*pow(X,2*n+1)/fact(2*n+1);
r1=r + pow(-1,n+1)*pow(X,2*n+1+1)/fact(2*n+1+1);
}
return 1/r;
}
}
void quick(int *temp, int i, int j)
{
int c, x,t=0;
m=i; k=j;
c=temp[(m+k) / 2];
do
{SravQuick++;
while (temp[m]<c) m++;
while (temp[k]>c) k--;
if (m<=k)
{if(m!=k)NazQuick++;
x=temp[m];
temp[m]=temp[k];
temp[k]=x;
m++;
k--;
}t++;
} while (m<k);
if (i<k) quick(temp, i, k);
if (m<j) quick(temp, m, j);
}