Объяснение:
2.5
#include <iostream>
using namespace std;
long long g = 1;
long long k = 1;
long long fac()
{
g*= k;
k + +;
return g;
}
int main()
long long n;
double s = 0;
cin > > n;
for(double i = 1 ; i < = n ; i + + )
s + = ( 2.0 * i ) / ( ( 2 * i + 1 ) *fac() );
cout< < s;
return 0;
2.6 #include <iostream>
double x, s = 0;
cin > > x > > n;
for(double i = 1 ; i < = n ; i + +)
s + = ( i + x ) / fac();
cout < < s;
Объяснение:
2.5
#include <iostream>
using namespace std;
long long g = 1;
long long k = 1;
long long fac()
{
g*= k;
k + +;
return g;
}
int main()
{
long long n;
double s = 0;
cin > > n;
for(double i = 1 ; i < = n ; i + + )
{
s + = ( 2.0 * i ) / ( ( 2 * i + 1 ) *fac() );
}
cout< < s;
return 0;
}
2.6 #include <iostream>
using namespace std;
long long g = 1;
long long k = 1;
long long fac()
{
g*= k;
k + +;
return g;
}
int main()
{
long long n;
double x, s = 0;
cin > > x > > n;
for(double i = 1 ; i < = n ; i + +)
{
s + = ( i + x ) / fac();
}
cout < < s;
return 0;
}