Антистресс program one; var izn,sum,i:real; begin read(n); izn := 1 + (1\sqr(2); sum := izn; i := 3; repeat sum := izn + (1\sqr(i); i := i+1; until i = n; writeln(sum); end.
0 votes Thanks 0
JustPeopleVAR ans: Real; n, i: Integer; BEGIN Read(n); For i := 1 to n do ans := ans + (1 / Sqr(i)); Write(ans); END.
Answers & Comments
program one;
var izn,sum,i:real;
begin
read(n);
izn := 1 + (1\sqr(2);
sum := izn;
i := 3;
repeat
sum := izn + (1\sqr(i);
i := i+1;
until i = n;
writeln(sum);
end.
ans: Real;
n, i: Integer;
BEGIN
Read(n);
For i := 1 to n do
ans := ans + (1 / Sqr(i));
Write(ans);
END.