rt
代码:
import java.util.Scanner; import java.math.*; public class Main{ public static void main(String[] args){ Scanner cin = new Scanner(System.in); BigInteger a, b, c, ans, temp1, temp2; while(cin.hasNextBigInteger()){ a = cin.nextBigInteger(); b = cin.nextBigInteger(); c = cin.nextBigInteger(); ans = c; int i = 3; while(i <= 99){ temp1 = a.add(b); ans = temp1.add(c); a = b; b = c; c = ans; /*System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(temp1); System.out.println(temp2);*/ i++; } System.out.println(ans); } } }
原文地址:http://blog.csdn.net/shengweisong/article/details/39105471