Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project2;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- var
- y:real;
- k,n:integer;
- s:real;
- function F(k:integer):real;
- begin
- if k<=n then
- begin
- result:= (((k)/(k - 1))*((k)/(k + 1)))*F(k+2);
- end
- else
- result := 1;
- end;
- BEGIN
- y:=1;
- writeln('vvedi n');
- readln(n);
- writeln(F(2));
- s:=1;
- k:=2;
- writeln('bez recursii');
- repeat
- s:=s*( ((k)/(k - 1)) * ((k)/(k+1)));
- k:=k+2;
- until k>n;
- writeln(s);
- readln;
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement