Quick actions

cmd+k|ctrl+k

Navigation

Languages

Lab5 (38)

Snippet info

Language

Cpp

Visibility

public

Author

buteskul5.6

Created

2018-10-25T19:24:58Z

Updated

2018-10-25T19:32:03Z

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	setlocale(LC_ALL, "ru");

	float n; //n - натуральное число 
	float S=0; //сумма прогресии
	

	cout << "Введите число" << endl;
	cin >> n;

	cout << endl;

	for (int i = 1; i < n; i++)
	{
		S += (1 / pow((2 * n + 1), 2));
		cout << S << endl;
		S += S;

	}
	cout << endl <<"Результат - "<< S << endl;
}
INFO