雕刻时光

just do it……nothing impossible
随笔 - 547, 文章 - 0, 评论 - 82, 阅读 - 86万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  java 高精度

摘要:View Code //第七题import java.util.*;class Vehicle{ protected int speed, kind; protected String color; Scanner cin=new Scanner(System.in); public Vehicle(int a){ //不带参数的构造方法 kind=a; System.out.println("构造完成"); } public void setSpeed(int a){ speed=a; } public vo... 阅读全文

posted @ 2011-09-26 21:00 huhuuu 阅读(1064) 评论(0) 推荐(0) 编辑

摘要:View Code import java.util.*;import java.math.*;import java.text.DecimalFormat;public class Main { public static void main(String args[]) { Scanner cin=new Scanner(System.in); double x1,y1,x2,y2; DecimalFormat df = new DecimalFormat("0.00"); while... 阅读全文

posted @ 2011-09-26 15:07 huhuuu 阅读(703) 评论(0) 推荐(0) 编辑

摘要:View Code class Point{ protected int x, y; // coordinates of the Point public Point(){ //不带参数的构造方法 x=0; y=0; System.out.println( "Point constructor: "+this.toString() ); } public Point(int a,int b){ //带参数的构造方法 x=a; y=b; System.out.println( "Point con... 阅读全文

posted @ 2011-09-26 14:30 huhuuu 阅读(533) 评论(0) 推荐(0) 编辑

摘要:推出公式;f[0]=1f[1]=1/2*f[0]f[2]=1/4*(f[0]+f[1])f[3]=1/6*(f[0]+f[1]+f[2])f[4]=1/8*(f[0]+f[1]+f[2]+f[3])……JAVA处理View Code import java.util.*;import java.math.*;public class Main { public static void main(String args[]) { Scanner cin=new Scanner(System.in); BigInteger a[],temp,all,fenz... 阅读全文

posted @ 2011-09-19 21:14 huhuuu 阅读(245) 评论(0) 推荐(0) 编辑

摘要:注意大数a,b是否相等比较不能 if(a==b)//虽然这样写语法没问题要用 .compareTo()的方法View Code 阅读全文

posted @ 2011-09-08 22:47 huhuuu 阅读(254) 评论(0) 推荐(0) 编辑

摘要:小数相加 注意1.1+1.9=4结果简单表示.stripTrailingZeros().toPlainString()//去掉大数后面多余的0,并用简单法表示View Code import java.util.*;import java.math.*;public class Main { public static void main(String args[]){ Scanner scan=new Scanner(System.in); while(scan.hasNextBigDecimal()){ BigDecimal a,b; ... 阅读全文

posted @ 2011-09-08 21:38 huhuuu 阅读(277) 评论(0) 推荐(0) 编辑

摘要:BigInteger 没有sqrt的功能,所以用二分做注意:BigInteger l,r,mid,x=scan.nextBigInteger();//有时会出现PE所以:BigInteger l,r,mid,x; x =scan.nextBigInteger();View Code 阅读全文

posted @ 2011-09-08 21:00 huhuuu 阅读(238) 评论(0) 推荐(0) 编辑

摘要:计算a^b-b^aView Code import java.util.*;import java.math.*;public class Solution { public static void main(String args[]){ Scanner scan=new Scanner(System.in); int a=scan.nextInt(); int b=scan.nextInt(); BigInteger x =BigInteger.valueOf(a); ... 阅读全文

posted @ 2011-09-08 18:49 huhuuu 阅读(226) 评论(0) 推荐(0) 编辑

摘要:toPlainString()按一般数学表达式表示toString()按科学型表示replaceAll("^0", "") 如果整数里有零,替换掉View Code import java.util.*;import java.math.*;public class Main { public static void main(String args[]){ Scanner scan=new Scanner(System.in); while(scan.hasNext()) { BigDecimal a=scan.nextB... 阅读全文

posted @ 2011-09-08 09:40 huhuuu 阅读(272) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示