Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
195 B
0
Indexable
Never
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int k, n;
	double g = 0;
	cin >> n >> k;
	for (int i = 0; i < n+1; i++)
	{
		g += pow(i, k);
	}
	cout << g;
}