#include <stdio.h>
int main(void)
{
int m, n, i, j, sum, x;
printf("1^m + 2^m + 3^m + ... + n^m を求める\n"); sum = 0;
for (i = 1; i <= n; i++) {
for (x = j = 1; j <= m; j++) {
x *= i;
}
sum += x;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluKHZvaWQpCnsKICAgIGludCBtLCBuLCBpLCBqLCBzdW0sIHg7CiAgICBwcmludGYoIjFebSArIDJebSArIDNebSArIC4uLiArIG5ebSDjgpLmsYLjgoHjgotcbiIpOwogICAgcHJpbnRmKCJtPSIpO3NjYW5mKCIlZCIsICZtKTsKICAgIHByaW50Zigibj0iKTtzY2FuZigiJWQiLCAmbik7CiAgICBzdW0gPSAwOwogICAgZm9yIChpID0gMTsgaSA8PSBuOyBpKyspIHsKICAgICAgICBmb3IgKHggPSBqID0gMTsgaiA8PSBtOyBqKyspIHsKICAgICAgICAgICAgeCAqPSBpOwogICAgICAgIH0KICAgICAgICBzdW0gKz0geDsKICAgIH0KICAgIHByaW50ZigiJWRcbiIsIHN1bSk7CiAgICByZXR1cm4gMDsKfQo=