BigInteger
package hsc.data.test;
import java.math.BigInteger;
public class Test {
public static void main(String[] args) {
System.out.println("愿你任何时候 都不缺从头再来的勇气 跟着自己的感觉走 心之所向 就是最好的结果");
BigInteger a=new BigInteger("1");
BigInteger aa=new BigInteger("200");
String s = "";
for (int i = 0; i < 199; i++) {
s += 200 + "*";
a = a.multiply(aa);
}
System.out.println(s);
System.out.println(a);
BigInteger e=new BigInteger("1");
BigInteger ee=new BigInteger("199");
String ss = "";
for (int i = 0; i < 200; i++) {
ss += 199 + "*";
e = e.multiply(ee);
}
System.out.println(ss);
System.out.println(e);
//进制转换
int decimal = 123;
System.out.println("十进制数:"+decimal+",转换为二进制:"+Integer.toBinaryString(decimal));
System.out.println("十进制数:"+decimal+",转换为八进制:"+Integer.toOctalString(decimal));
System.out.println("十进制数:"+decimal+",转换为十六进制:"+Integer.toHexString(decimal));
System.out.println("二进制数:"+"1111011" +",转换为十进制:"+Integer.valueOf("1111011", 2));
System.out.println("八进制数:"+"173" +",转换为十进制:"+Integer.valueOf("173", 8));
System.out.println("十六进制数:"+"7b" +",转换为十进制:"+Integer.valueOf("7b", 16));
System.out.println("最后");
}
}