Tag: biginteger

Java斐波那契数列BigInteger

我试图运行一个程序,找到斐波那契数列中的第n个序列; 但是,问题是,我想要在其中实现BigInteger,因此它可以运行1000甚至更多的值。 有什么办法有效地添加它? import java.util.*; import java.math.*; public class fib { //Arkham /*public static BigInteger fibonacci2(int n) { if (n == 0 || n == 1) { return BigInteger.ONE; } return fibonacci2(n – 2).add(fibonacci2(n-1)); }*/ public static int Fibonacci(int n) { int num = Math.abs(n); if (num == 0) { return 0; } else if […]

Kotlin作为BigInteger输入

我想读两个50位数字并打印他们的总和,但是我不能以BigInteger的形式获得Kotlin的输入。 我怎样才能读取Kotlin输入BigInteger? 还有别的办法可以解决这个问题吗?

BigInteger在Kotlin

我需要使用BigInteger,但在kotlin中找不到类似的东西。 在java的BigInteger的kotlin中有没有其他类? 要么 我应该将java类导入kotlin吗?