Untitled
unknown
plain_text
3 years ago
244 B
7
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(n1, k);
}
cout << s;
}
Editor is loading...