オーケー！これがその関数だ：

```cpp
#include <iostream>
#include <cmath>

using namespace std;

int sum_of_powers(int n, int k) {
    int sum = 0;
    sum = (n*(n+1))/2; // sum of natural numbers from 1 to n
    int sum_of_powers = pow(sum, k); // sum of powers from 1 to n
    return sum_of_powers;
}

int main() {
    int n, k;
    cout << "Enter two positive integers n and k: ";
    cin >> n >> k;
    int result = sum_of_powers(n, k);
    cout << "The sum of the numbers from 1^k to n^k is: " << result << endl;
    return 0;
}
```

コードについてもっと助けが必要な場合は、私に知らせてください！
Okay! Here is the function:

```cpp
#include <iostream>
#include <cmath>

using namespace std;

int sum_of_powers(int n, int k) {
    int sum = 0;
    sum = (n*(n+1))/2; // sum of natural numbers from 1 to n
    int sum_of_powers = pow(sum, k); // sum of powers from 1 to n
    return sum_of_powers;
}

int main() {
    int n, k;
    cout << "Enter two positive integers n and k: ";
    cin >> n >> k;
    int result = sum_of_powers(n, k);
    cout << "The sum of the numbers from 1^k to n^k is: " << result << endl;
    return 0;
}
```

Let me know if you need any more help with your code!