Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
245 B
0
Indexable
Never
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int n, k, n1,s;
	cout << "vvedite n a potom k";
	cin >> n >> k;
	n1 = 0;
	s = 0;
	while(n1!=n) {
		n1++;
		s = s + pow(n, k);
	}
	cout << s+1;
	
	


}