View Code of Problem 23

import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		long[]arr = new long[90];
		arr[0] = 1;
		arr[0] = 2;
		for (int i = 2; i < 90; i++) {
			arr[i] = arr[i-1]+arr[i-2];
		}
		Scanner sc = new Scanner(System.in);
		int m;
		while ((m = sc.nextInt())!=0) {
			System.out.println(arr[m-1]);
		}
	}
}

Double click to view unformatted code.


Back to problem 23