import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
BigInteger a = new BigInteger("2");
BigInteger b = new BigInteger("3");
BigInteger A = new BigInteger("2");
BigInteger B = new BigInteger("3");
for (int i = 1; i < 123456; i++) {
BigInteger newA = A.multiply(a).subtract(B.multiply(b));
BigInteger newB = A.multiply(b).add(B.multiply(a));
A = newA;
B = newB;
}
if(B.compareTo(BigInteger.ZERO) > 0) {
System.out.println(A + "+" + B + "i");
} else if(B.compareTo(BigInteger.ZERO) < 0){
System.out.println(A + "" + B + "i");
}
}
}
复数幂
最新推荐文章于 2023-01-03 17:23:16 发布