新学到的:字符串去掉前导0;字符串的前缀去掉字符串的若干前缀View Code 1 import java.math.*; 2 import java.io.*; 3 import java.util.*; 4 public class Main{ 5 public static void main(String args[]) 6 { 7 Scanner cin=new Scanner(System.in); 8 int n,i; 9 BigDecimal r,a;10 BigDecimal one=new B... Read More
View Code 1 import java.math.*; 2 import java.io.*; 3 import java.util.*; 4 public class Main{ 5 public static void main(String args[]) 6 { 7 Scanner cin=new Scanner(System.in); 8 int i,j,k,n,t; 9 BigInteger a,b,ans;10 t=cin.nextInt();11 i=0;1... Read More
卡特兰数 C(2*n,n)/(n+1);View Code 1 //java 卡特兰数 2 import java.math.*; 3 import java.io.*; 4 import java.util.*; 5 public class Main{ 6 public static void main(String args[]) 7 { 8 Scanner cin=new Scanner(System.in); 9 int i,j,k,n;10 BigInteger a,b,ans;11 while(c... Read More
http://hi.baidu.com/acmdearway/blog/item/e08db230563e3d13ebc4afa2.htmlString st = Integer.toString(num, base); // 把num当做10进制的数转成base进制的st(base <= 35).int num = Integer.parseInt(st, base); // 把st当做base进制,转成10进制的int(parseInt有两个参数,第一个为要转的字符串,第二个为说明是什么进制).BigInter m = new BigInteger(st, base); // st是 Read More