Created
September 28, 2012 06:50
-
-
Save clowwindy/3798325 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class test { | |
public static int fib(int n) { | |
if (n < 2) { | |
return n; | |
} else { | |
return fib(n - 1) + fib(n - 2); | |
} | |
} | |
public static void main(String[] args) { | |
for(int i = 0; i < 99999999; i++) { | |
// System.out.print(fib(42) + "\n"); | |
} | |
} | |
} | |
$ javac test.java | |
$ time java test | |
real 0m0.084s | |
user 0m0.092s | |
sys 0m0.015s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment