Package com. njupt. acm; import java. math. bigInteger; import java. util. role; public class POJ_2413 {public static void main (String [] args) {role = new role (System. in); BigInteger [] fig = new BigInteger [501]; fig [1] = new BigInteger ("1"); fig [2] = new BigInteger ("2 "); int I; for (I = 3; I <501; ++ I) {// calculate the Fibonacci series [I] = fibs [I-1]. add (fibs [I-2]);} BigInteger zero = new BigInteger ("0"); while (true) {BigInteger a = empty. nextBigInteger (); BigInteger B = bytes. nextBigInteger (); if (. compareTo (zero) = 0 & B. compareTo (zero) = 0) {break;} int left = 0; int right = 0; boolean flag1 = true;/*** calculates the number of Fibonacci numbers in a range, in this case, not the interval, but the Fibonacci array */for (I = 1; I <501; ++ I) {// fib [500] has reached 10 ^ 100. if (flag1 & (fibs [I]. compareTo (a) = 1 | fibs [I]. compareTo (a) = 0) {left = I; flag1 = false;} if (fibs [I]. compareTo (B) = 1) {// handle the right boundary right = I; break;} if (fibs [I]. compareTo (B) = 0) {right = I + 1; break ;}} System. out. println (right-left );}}}