public class ceshi {
public static void main(String[] args) {
int a = 9;
int b = 7;
DecimalFormat df=new DecimalFormat("0.00");
System.out.println(a+b);
System.out.println(a-b);
System.out.println(a/b);
System.out.println(a*b);
System.out.println((a+b)/2);
System.out.println(df.format((float)a/b));
}
}
java计算数,保留后两位数
最新推荐文章于 2022-11-10 17:03:10 发布