public class Fibonacci { static int resitve[] = new int[1000]; static int f(int n) { if(resitve[n] != 0 ) { return(resitve[n]); } if(n == 0 || n == 1) { return(1); } else { int a = f(n - 1); int b = f(n - 2); resitve[n - 1] = a; resitve[n - 2] = b; return(a + b); } } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(f(100)); } }