poj 3982
来源:互联网 发布:开源软件社区 编辑:程序博客网 时间:2024/05/29 19:54
题目意思是给出三个值a1,a2,a3,求出a99,且a(n)=a(n-1)+a(n-2)+a(n-3).
这题明显可以化解出一个公式。但这里我用了java的大数运算,直接模拟了。
import java.math.BigInteger;import java.util.Scanner;public class Main{ public static void main(String[] args) { BigInteger[] d =new BigInteger[200]; Scanner in = new Scanner(System.in); while(in.hasNext()) { d[0] = in.nextBigInteger(); d[1] = in.nextBigInteger(); d[2] = in.nextBigInteger(); for(int i=3;i<100;i++) { d[i] = d[i-1].add(d[i-2].add(d[i-3])); } System.out.println(d[99]); } }}
- poj 3982
- POJ 3982
- POJ 3979-3982~
- poj 3982 序列
- poj 3982 高精度java
- POJ 3982 序列
- Poj 3982 序列
- poj 3982 序列
- POJ 3982 序列
- 【POJ】 3982 序列
- POJ 3982 序列 中文
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- String.split()方法的详解
- 安装、操作sqlserver时遇见的问题
- Android AsyncTask深入分析
- 电脑病毒的类型
- Linux 下的图形库介绍
- poj 3982
- BD2 SQL错误代码释义
- HP-UX系统日志文件
- js获取String的实际长度
- MyEclipse优化
- Indexing NULL table column values for fast SQL performance
- 实现选择全部单选框的实例
- App数据格式之解析Json
- 面向接口设计