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://acm.nyist.net/JudgeOnline/problem.php?pid=114
时间: 2024-10-27 07:30:45