#include <stdio.h>
unsigned long long xdon (unsigned long long x, unsigned long long n) {
unsigned long long wynik = 1;
for (;n;n--) wynik *= x;
return wynik;
}
int main (void) {
unsigned long long suma, n;
//printf("Podaj n: ");
//scanf("%llu", &n);
printf ("WSZYSTKIE WYNIKI DLA N>15 SĄ BŁĘDNE\n"); for (unsigned long long i = 1; i < 11; ++i) {
for(suma = 0, n = i; n; --n) suma += xdon(n, n);
printf ("n: %2llu\tWynik: %12llu\n", i
, suma
); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp1bnNpZ25lZCBsb25nIGxvbmcgeGRvbiAodW5zaWduZWQgbG9uZyBsb25nIHgsIHVuc2lnbmVkIGxvbmcgbG9uZyBuKSB7CiAgICB1bnNpZ25lZCBsb25nIGxvbmcgd3luaWsgPSAxOwogICAgZm9yICg7bjtuLS0pIHd5bmlrICo9IHg7CiAgICByZXR1cm4gd3luaWs7Cn0KCmludCBtYWluICh2b2lkKSB7CiAgICB1bnNpZ25lZCBsb25nIGxvbmcgc3VtYSwgbjsKICAgIC8vcHJpbnRmKCJQb2RhaiBuOiAiKTsKICAgIC8vc2NhbmYoIiVsbHUiLCAmbik7CiAgICBwcmludGYgKCJXU1pZU1RLSUUgV1lOSUtJIERMQSBOPjE1IFPEhCBCxYHEmERORVxuIik7CiAgICBmb3IgKHVuc2lnbmVkIGxvbmcgbG9uZyBpID0gMTsgaSA8IDExOyArK2kpIHsKCQlmb3Ioc3VtYSA9IDAsIG4gPSBpOyBuOyAtLW4pIHN1bWEgKz0geGRvbihuLCBuKTsKICAgIAlwcmludGYgKCJuOiAlMmxsdVx0V3luaWs6ICUxMmxsdVxuIiwgaSwgc3VtYSk7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==