Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我是来贴代码的In Reply To:Re:java 水过30~~~ c++望尘莫及啊 遇大数果断java Posted by:Delostic at 2011-08-07 18:00:17 import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Scanner; public class Main { static Scanner cin = new Scanner(System.in); static PrintWriter cout = new PrintWriter(System.out, true); public static void main(String[] args) { BigInteger a,b,c,ans = null; while(cin.hasNext()) { c = cin.nextBigInteger(); b = cin.nextBigInteger(); a = cin.nextBigInteger(); for(int i=3;100-i>0;i++) { ans = a.add(b).add(c); c = b; b = a; a = ans; } cout.println(ans); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator