Untitled

Anonymous
plain_text
11/17/2022 1:51 PM
276 B
16
Indexable
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int n,f = 0;
	double g = 0;
	cin >> n ;
	for (int i = 1; i < n+1; i++)
	{
		g += pow(i, n-f);
		f += 1;
	}
	cout << g;
}
Editor is loading...