随笔分类 - java学习
摘要:Map map = new HashMap(); map.put("a", "1"); map.put("b", "2"); map.put("c", "3"); map.put("d", "4"); map.put("e", "5"); for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { Object key = it
阅读全文
摘要:How Many Fibs?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2814Accepted Submission(s): 1112Problem DescriptionRecall the definition of the Fibonacci numbers:f1 := 1f2 := 2fn := fn-1 + fn-2 (n >= 3)Given two numbers a and b, calculate how many
阅读全文
摘要:A == B ?Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 47896Accepted Submission(s): 7324Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".Inputeach test case contains two
阅读全文
摘要:求高精度幂Time Limit:500MSMemory Limit:10000KTotal Submissions:117394Accepted:28569Description对数值很大、精度很高的数进行高精度计算是一类十分常见的问题。比如,对国债进行计算就是属于这类问题。现在要你解决的问题是:对一个实数R( 0.0 < R < 99.999 ),要求写程序精确计算 R 的 n 次方(Rn),其中n 是整数并且 0 < n <= 25。InputT输入包括多组 R 和 n。 R 的值占第 1 到第 6 列,n 的值占第 8 和第 9 列。Output对于每组输入,要求
阅读全文
摘要:Integer InquiryTime Limit:1000MSMemory Limit:10000KTotal Submissions:26642Accepted:10325DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.``This superco
阅读全文
摘要:ACM中java的使用这里指的java速成,只限于java语法,包括输入输出,运算处理,字符串和高精度的处理,进制之间的转换等,能解决OJ上的一些高精度题目。1.输入:格式为:Scannercin=newScanner(newBufferedInputStream(System.in));例程:importjava.io.*;importjava.math.*;importjava.util.*;importjava.text.*;publicclassMain{publicstaticvoidmain(String[]args){Scannercin=newScanner(newBuffer
阅读全文
摘要:Basic remainsTime Limit:1000MSMemory Limit:65536KTotal Submissions:4429Accepted:1869DescriptionGiven a base b and two non-negative base b integers p and m, compute p mod m and print the result as a base b integer. p mod m is defined as the smallest non-negative integer k such that p = a*m + k for so
阅读全文
摘要:如何在Eclipse中显示行号这个问题,困扰了我好长时间,今天终于找到了。其实很简单,经过以下几步,就一切搞定了:1)先打开一个类,如下图:2)然后打开视图,如何打开呢?最能解决问题的也就在此了:按Ctrl+F10,效果如下图:3)然后选择Show Line Numbers4)最后的效果如图:5)就这样简单,你就可以在编辑器中看到你的代码的行号了。其实最重要的是知道Ctrl+F10能打开视图菜单就一切搞定了。转载来自:http://www.blogjava.net/zhyiwww/archive/2006/10/27/77622.html
阅读全文
摘要:转载来自:http://lynclass.blog.sohu.com/84582061.html匹配中文字符的正则表达式: [\u4e00-\u9fa5], [\一-\龥]可以.评注:匹配中文还真是个头疼的事,有了这个表达式就好办了匹配双字节字符(包括汉字在内):[^\x00-\xff]评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)匹配空白行的正则表达式:\n\s*\r评注:可以用来删除空白行匹配HTML标记的正则表达式:]*>.*?|评注:网上流传的版本太糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套标记依旧无能为力匹配首尾空白字符的正则表达式:^\s*|
阅读全文

浙公网安备 33010602011771号