题目描述
思路分析
代码实现
package com.atguigu.TEST;import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.math.BigInteger;class Main{public static void main(String[] args) {BigInteger two = BigInteger.valueOf(2);BigInteger three = BigInteger.valueOf(3);BigInteger zero = BigInteger.valueOf(0);BigInteger a = BigInteger.valueOf(2);BigInteger b = BigInteger.valueOf(3);BigInteger aa=null;BigInteger bb=null;for (int i = 0; i < 123455; i++) {aa=a.multiply(two).subtract(b.multiply(three));//a*2-b*3bb=a.multiply(three).add(b.multiply(two));//a*3+b*2a=aa;b=bb;}try {System.setOut(new PrintStream(new File("D:\\pwd.txt")));} catch (FileNotFoundException e) {e.printStackTrace();}System.out.println(aa+(bb.compareTo(zero)<0?"-":"+")+bb+"i");}}