Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function f( n : integer) : integer;
- begin
- if n <= 1 then result := 0;
- if (n>1) and (n mod 2 = 0) then result := n div 2 + f(n-1) + 2;
- if (n>1) and (n mod 2 = 1) then result := f(n-1) + 3*n*n;
- end;
- begin
- print(f(49));
- end.
Advertisement
Add Comment
Please, Sign In to add comment