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
23
u/chickendodo Jun 10 '12
170231313848935722638150796779640851945068455427578185827195398362973826364521413406220185242786777384930203231191518363137019177032178834940596091714183515945074165199516057854347710384719307736462377651250690859257991759548357679903819496806306533251173331842626175304038945753