MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/funny/comments/utfkw/pidgonacci_sequence/c4yj3bv/?context=3
r/funny • u/[deleted]
[deleted] — view deleted post
22k comments sorted by
View all comments
Show parent comment
3
Personally?
import java.math.BigInteger;
public class Main {
public static void main(String[] args) { String s1 = "[INSERT NUMBER 1 HERE]"; String s2 = "[INSERT NUMBER 2 HERE]"; System.out.println(addBig(s1, s2)); //Copy this } public static BigInteger addBig(String number1, String number2){ BigInteger num1 = new BigInteger(number1), num2 = new BigInteger(number2); return num1.add(num2); } public static BigInteger skipStep(String number1, String number2){ BigInteger num1 = new BigInteger(number1), num2 = new BigInteger(number2); BigInteger firstStep = num1.add(num2); return firstStep.add(num1.max(num2)); //This skips a step in the Fibonacci sequence, by adding the bigger number twice. }
}
View all comments
Show parent comment
3
u/Bloodshot025 Jun 10 '12
Personally?
import java.math.BigInteger;
public class Main {
}