java除法保留到小数点后两位, (float)totalsexwoman/totalCounts totalsexwoman为长整形的,如果去掉(float)结果为0,因为整形除以整形还是整形。 只有将结果转化为浮点型才可以。