SHARE
TWEET

Untitled

a guest Aug 12th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function SeriaRekursiv(N: Integer): Integer;
  2. begin
  3.   if N = 1 then
  4.     Result := 2
  5.   else
  6.     Result := 2 * N * SeriaRekursiv(N - 1)
  7. end;
  8.  
  9. function SeriaIterativ(N: Integer): Integer;
  10. var
  11.   I: Integer;
  12. begin
  13.   Result := 1;
  14.  
  15.   for i := 1 to N do
  16.     Result := Result * 2 * I;
  17. end;
  18.  
  19. begin
  20.   Writeln(SeriaIterativ(5));
  21.   Writeln(SeriaRekursiv(5));
  22.   ReadLn;
  23. end.
RAW Paste Data
Top