How Many Fibs? hdu1316 高精度
来源:互联网 发布:kako女装淘宝旗舰店 编辑:程序博客网 时间:2024/05/19 15:43
http://acm.hdu.edu.cn/showproblem.php?pid=1316
大数我就用JAVA。 膜拜JAVA,JAVA无敌。
今天学会了用eclipse-java 调试。
F8跳到下一个断点,ctrl+shift+b设断点,F5、F6单步执行。
import java.math.*;import java.util.Scanner;public class Main {public static void main(String args[]){int N=500;BigInteger ficc[]=new BigInteger[N];init(ficc);Scanner cin=new Scanner(System.in);BigInteger a,b;int i,count;while (cin.hasNext()){a=cin.nextBigInteger();b=cin.nextBigInteger();count=0;if (a.compareTo(BigInteger.ZERO)==0&&b.compareTo(BigInteger.ZERO)==0)break;for (i=0;i<N;i++){if (ficc[i].compareTo(a)!=-1&&ficc[i].compareTo(b)!=1)count++;if (ficc[i].compareTo(b)==1)break;}System.out.println(count);}cin.close();}public static void init(BigInteger ficc[]){int i;BigInteger ten,c;ficc[0]=new BigInteger("1");ficc[1]=new BigInteger("2");c=new BigInteger("1");ten=new BigInteger("10");for (i=0;i<101;i++)c=c.multiply(ten);i=2;while (ficc[i-1].compareTo(c)==-1){ficc[i]=ficc[i-1].add(ficc[i-2]);i++;}}}
- How Many Fibs? hdu1316 高精度
- hdu1316(How Many Fibs?)高精度
- HDU1316:How Many Fibs?
- hdu1316 How Many Fibs?
- hdu1316 How Many Fibs?
- hdu1316 How Many Fibs?
- hdu1316 How Many Fibs?
- HDU1316 How Many Fibs? 【大数】
- HDU1316 How Many Fibs? 【大数】
- hdu1316 How Many Fibs?(大数)
- HDU1316:How Many Fibs?(大数JAVA)
- Java 大数之大数高精度斐波那契 UVA_10579&&HDU1316 How many Fibs?
- How many Fibs?(高精度)
- How many Fibs?(高精度)
- hdu1316 How Many Fibs? (java大数练习第二弹)
- pku 2413 How many Fibs? 【java高精度】
- hdu 1316 How Many Fibs? (模拟高精度)
- POJ2413 How many Fibs?【高精度】【二分】
- ASM工具集合-amdu
- 九度OJ 题目1066:字符串排序
- 开根号
- 影响Java EE性能的十大问题
- Hive原理与不足
- How Many Fibs? hdu1316 高精度
- Handling network configuration changes
- 中文转UTF
- 百度地图SDK for Android【简介】
- 利用ffmpeg将无命名规则的静态图片合成视频
- zookeeper 权限概述
- 关于GCD
- Java和C++的区别
- C#几种实现MD5加密