Quick actions

cmd+k|ctrl+k

Navigation

Languages

metall(!!!!)

Snippet info

Language

Cpp

Visibility

public

Author

andrusus.korotkovus

Created

2018-11-20T07:34:49Z

Updated

2018-11-20T08:48:02Z

#include <iostream>
#include <math.h>


using namespace std;

int main() {
	double i, a, x, sum, n, res;
	res = 1;
	a = 0;
	cin >> n >> x;
	if (1 < n && n < 10) {
		for (i = 1; i <=n; i++) {
			res = res * i;
			a = a+ pow(x, i) / res;
		}	
		a++;
		cout << a <<endl;
	}
	
	return 0;
}
INFO