Var n,i:integer; s:real; function sum(n:integer):real; begin if n=1 then sum:=1 else sum:=(1/n)+sum(n-1); end; begin writeln('n='); readln(n); writeln('sum=',sum(n)); readln; end.
Function sum(n: integer): real; Var A:real; Begin A:=1; For N:= 2 to N do A:=A+(1/N); sum:=A End; Var N:integer; Begin Write('N = ');ReadLn(N); Write(sum(N)) End.
s:real;
function sum(n:integer):real;
begin
if n=1 then
sum:=1
else
sum:=(1/n)+sum(n-1);
end;
begin
writeln('n=');
readln(n);
writeln('sum=',sum(n));
readln;
end.
Var A:real;
Begin
A:=1;
For N:= 2 to N do
A:=A+(1/N);
sum:=A
End;
Var N:integer;
Begin
Write('N = ');ReadLn(N);
Write(sum(N))
End.