LeeBlog

导航

随笔分类 -  JAVA

请在提交时把名称都改成Main
HDU 1063 Exponentiation
摘要:JAVA 水过import java.io.*;import java.util.*;import java.math.*;public class aa{ public static void main( String[] args ) { BigDecimal a,b; int c; Scanner cin = new Scanner(System.in); while( cin.hasNext() ) { a = cin.nextBigDecimal(); b = BigDecimal.valueOf(1); c = cin.nextInt(); for( int i = 0; i &l 阅读全文

posted @ 2011-05-10 11:10 LeeBlog 阅读(226) 评论(0) 推荐(0)

POJ PKU 2305 java大数进制转化 JAVA 大数转换成字符串 转
摘要:题目描述:给你两个n进制数a和b。以n进制的形式输出a % b。解题报告:String 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是字符串,base是st的进制.1.如果要将一个大数以2进制形式读入 阅读全文

posted @ 2011-05-10 10:15 LeeBlog 阅读(327) 评论(0) 推荐(0)

HDU 1715 大菲波数
摘要:JAVA水过import java.io.*;import java.util.*;import java.math.*;public class aa{ public static void main( String[] args ) { BigInteger f[] = new BigInteger[1005]; f[1] = BigInteger.valueOf(1); f[2] = BigInteger.valueOf(1); for( int i = 3; i < 1005; ++i ) f[i] = f[i-1].add(f[i-2]); Scanner cin = new 阅读全文

posted @ 2011-05-10 09:55 LeeBlog 阅读(197) 评论(0) 推荐(0)

大明 A + B JAVA
摘要:java 水过import java.io.*;import java.util.*;import java.math.BigDecimal;public class aa{ public static void main( String args[] ) { BigDecimal a,b; Scanner in = new Scanner ( System.in ); //int t = in.nextInt(); while( in.hasNext() ) { a = in.nextBigDecimal();b = in.nextBigDecimal(); BigDecimal c = a 阅读全文

posted @ 2011-05-09 21:33 LeeBlog 阅读(212) 评论(0) 推荐(0)

HDU 2054 A == B ?
摘要:JAVAimport java.io.*;import java.util.*;import java.math.*;import java.io.BufferedInputStream; public class aa{ public static void main( String[] args ) { BigDecimal a,b; Scanner cin = new Scanner(System.in); while( cin.hasNext() ) { a = cin.nextBigDecimal(); b = cin.nextBigDecimal(); a = a.stripTra 阅读全文

posted @ 2011-04-09 13:47 LeeBlog 阅读(749) 评论(0) 推荐(0)

HDU 1316 How Many Fibs? 大数
摘要:Javaimport java.io.*;import java.util.*;import java.math.*;public class aa{ public static void main( String[] args ) { BigInteger f[] = new BigInteger[505],a,b; f[1] = BigInteger.valueOf(1); f[2] = BigInteger.valueOf(2); for( int i = 3; i < 505; ++i ) f[i] = f[i-1].add( f[i-2] ); Scanner cin = ne 阅读全文

posted @ 2011-04-08 21:21 LeeBlog 阅读(344) 评论(0) 推荐(0)

HDU 1047 Integer Inquiry
摘要:JAVA水过import java.io.*;import java.util.*;import java.math.*;public class aa{ public static void main( String[]args ) { Scanner cin=new Scanner(System.in); int t; cin.hasNextInt(); t = cin.nextInt(); for( int i = 1; i <= t; ++i ) { BigInteger a,b,c; c = BigInteger.valueOf(0); b = c; while( cin.ha 阅读全文

posted @ 2011-03-29 20:15 LeeBlog 阅读(212) 评论(0) 推荐(0)

HDU 1042 N!
摘要:JAVAimport java.io.*;import java.util.*;import java.math.BigInteger;import java.math.BigDecimal;;public class aa{ public static void main( String args[] ) { int a; Scanner in = new Scanner ( System.in ); //int t = in.nextInt(); while( in.hasNext() ) { a = in.nextInt(); BigInteger res = BigInteger.ON 阅读全文

posted @ 2011-03-29 17:26 LeeBlog 阅读(255) 评论(0) 推荐(1)

HDU 1002 A + B Problem II 大数相加
摘要:java 水过import java.io.*;import java.util.*;import java.math.BigInteger;public class aa{ public static void main( String args[] ) { BigInteger a,b; Scanner in = new Scanner ( System.in ); int t = in.nextInt(); for( int i = 1; i <= t; ++i ) { in.hasNext(); a = in.nextBigInteger();b = in.nextBigInte 阅读全文

posted @ 2011-03-29 15:51 LeeBlog 阅读(902) 评论(1) 推荐(0)