MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/funny/comments/utfkw/pidgonacci_sequence/c4ykn7u/
r/funny • u/[deleted] • Jun 09 '12
[deleted] — view deleted post
22k comments sorted by
View all comments
Show parent comment
2
You want to numbers?
1 u/publiclibraries Jun 10 '12 I'll do it. Script pls? 1 u/Bloodshot025 Jun 10 '12 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. }}Java implementation
1
I'll do it. Script pls?
1 u/Bloodshot025 Jun 10 '12 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. }}Java implementation
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. }
}
Java implementation
View all comments
Show parent comment
2
u/Bloodshot025 Jun 10 '12
You want to numbers?