N — натуральное число. Вычислить [tex] 1^{1}+2 ^{2}+...N ^{N} [/tex] (Pascal). Использовать цикл в цикле.
Answers & Comments
A1dar
Var i, j, n, sum, mult: integer; begin read(n); for i := 1 to n do begin mult := 1; for j := 1 to i do mult := mult * i; sum := sum + mult; end; writeln(sum); end.
Answers & Comments
i, j, n, sum, mult: integer;
begin
read(n);
for i := 1 to n do
begin
mult := 1;
for j := 1 to i do
mult := mult * i;
sum := sum + mult;
end;
writeln(sum);
end.