Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int fib(int n) =
- if n < 2 then n
- else fib(n-1) + fib(n-2)
- int ifib(int n) =
- if n < 2 then n else do
- int current = 1;
- int previous = 1;
- while n > 2 do
- int sum = current + previous;
- previous = current;
- current = sum;
- n = n-1;
- done;
- current;
- done
- void main() = do
- print ifib(100000*12.3*'a');
- done
Advertisement
Add Comment
Please, Sign In to add comment