Program test; function s(n,a:integer) : real; var i,p:integer; begin p:=1; if n>1 then begin for i:=1 to n do p:=p*a; s:=p; end;
end; function sum(n:integer) : real; var i:integer; sum1:real; begin for i:=1 to n do begin sum1:=sum1+(2/3)*s(i,n); end; sum:=sum1; end; var n:integer; begin write('Введите количество чисел '); readln(n); writeln(sum(n)); end.
function s(n,a:integer) : real;
var i,p:integer;
begin
p:=1;
if n>1 then begin
for i:=1 to n do p:=p*a;
s:=p;
end;
end;
function sum(n:integer) : real;
var i:integer;
sum1:real;
begin
for i:=1 to n do begin
sum1:=sum1+(2/3)*s(i,n);
end;
sum:=sum1;
end;
var
n:integer;
begin
write('Введите количество чисел ');
readln(n);
writeln(sum(n));
end.