const n = 3; const x = 1;
var s, c: double;
var a: integer;
begin
s := x;
a := -1;
for var i:= 1 to n do begin
for var j:= 1 to i do
c := c * x;
a := -a;
s := s + a*c/(i * i);
c := x;
end;
write(s);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const n = 3; const x = 1;
var s, c: double;
var a: integer;
begin
s := x;
a := -1;
for var i:= 1 to n do begin
for var j:= 1 to i do
c := c * x;
a := -a;
s := s + a*c/(i * i);
c := x;
end;
write(s);
end.