0_0_3108251_27944\Main.java:1: 类 hdu_1316 是公共的,应在名为 hdu_1316.java 的文件中声明
import java.io.*;import java.util.*;import java.math.*;public class hdu_1316 {public static void main(String[] args){int maxn=505;BigInteger []arr=new BigInteger[maxn];BigInteger a,b;arr[1]=BigInteger.valueOf(1);arr[2]=BigInteger.valueOf(2);for(int i=3;i<maxn;i++){arr[i]=arr[i-1].add(arr[i-2]);}Scanner cin=new Scanner(System.in);while(cin.hasNextBigInteger()){a=cin.nextBigInteger();b=cin.nextBigInteger();if(a.compareTo(BigInteger.ZERO)==0 && b.compareTo(BigInteger.ZERO)==0) break;int cnt=0;for(int i=1;i<maxn;i++){if(arr[i].compareTo(b)>0) break;if(arr[i].compareTo(a)>=0 && arr[i].compareTo(b)<=0) cnt++;}System.out.println(cnt);}}}
|