算法之合格率

//计算合格率      字符串转整数型   num1:合格数     num2:不合格数
int num1 = Integer.parseInt(hegeNum);
int num2 = Integer.parseInt(buhegeNum);
double d = (num1*1.0)/(num1+num2);
String hegeLv = String.format("%.2f", d);

猜你喜欢

转载自blog.csdn.net/liutianjie/article/details/86163305