Untitled

 avatar
unknown
plain_text
2 years ago
245 B
2
Indexable
#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;
	
	


}
Editor is loading...