Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab5 (73)

Snippet info

Language

Cpp

Visibility

public

Author

buteskul5.6

Created

2018-10-25T20:13:26Z

Updated

2018-10-27T14:39:41Z

#include <iostream>

using namespace std;

int main()
{
	setlocale(LC_ALL, "ru");
	int n, k = 1;
	double S = 1, s=0;

	do
	{
		cout << "Введите n" << endl;
		cin >> n;
	} while (n >= 10);


	for (int i = 1; i <= n; i++)
	{
		k *= i;
		cout << "\t" << k << endl;	

		s += k;
	}
	S += 1 / s;

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