public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter first number.");
BigInteger num1 = new BigInteger(s.nextLine());
System.out.println("Enter the second number.");
BigInteger num2 = new BigInteger(s.nextLine());
BigInteger next = num1.add(num2);
do {
s.nextLine();
System.out.println(next);
num1 = num2;
num2 = next;
next = num1.add(num2);
} while (s.hasNextLine());
}
View all comments
Show parent comment
19
u/Bloodshot025 Jun 10 '12
40186161967450196314115707578083977303526220308022101019527415358677343922103980461978710518473813224863190295643416077018847754196316747952705481034533959100929175725380930243343107489163398226940325093521551637389617932423949565568511854885439268439656836922898946040950679815