double类型结果几位小数啊
public class ArithmeticDemo{public static void main(String[] args){
int i=37;
int j=42;
double x=27.475;
double y=7.22;
System.out.println("i="+i);
System.out.println("j="+j);
System.out.println("x="+x);
System.out.println("y="+y);
System.out.println("i+j="+(i+j));
System.out.println("x+y="+(x+y));
System.out.println("i-j="+(i-j));
System.out.println("x-y="+(x-y));
System.out.println("i*j="+(i*j));
System.out.println("x*y="+(x*y));
System.out.println("i/j="+(i/j));
System.out.println("x/y="+(x/y));
System.out.println("i%j="+(i%j));
System.out.println("x%y="+(x%y));
System.out.println("j+y="+(j+y));
System.out.println("i*x="+(i*x));
}
}
我是莱鸟,请指导,谢谢。。。