输入两个整数, 计算百分比

	public static String getPercent(int x, int total){
  

double result=(x*1.0)/(total*1.0);
System.out.println(result);


DecimalFormat df1=new DecimalFormat("0.0000%");

String final_result=df1.format(result);
return final_result;
}
    原文作者:alleni123
    原文地址: https://blog.csdn.net/alleni123/article/details/84617043
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞