import java.math.BigInteger;
public class FibonacciNumbers {
public static void main(String[] args) {
if (args.length > 0) {
fib(Integer.parseInt(args[0]));
} else {
fib(1000);
}
}
private static void fib(int way) {
System.out.println("0: 0");
System.out.println("1: 1");
BigInteger tempSaver;
BigInteger prev = new BigInteger("0");
BigInteger curr = new BigInteger("1");
for (int i = 0; i < way - 1; i++) {
System.out.println(i + 2 + ": " + (prev.add(curr)));
tempSaver = curr;
curr = prev.add(curr);
prev = tempSaver;
}
}
}
public class FibonacciNumbers {
public static void main(String[] args) {
if (args.length > 0) {
fib(Integer.parseInt(args[0]));
} else {
fib(1000);
}
}
private static void fib(int way) {
System.out.println("0: 0");
System.out.println("1: 1");
BigInteger tempSaver;
BigInteger prev = new BigInteger("0");
BigInteger curr = new BigInteger("1");
for (int i = 0; i < way - 1; i++) {
System.out.println(i + 2 + ": " + (prev.add(curr)));
tempSaver = curr;
curr = prev.add(curr);
prev = tempSaver;
}
}
}