------- <a href="http://www.itheima.com" target="blank">android培训</a>、<a href="http://www.itheima.com" target="blank">java培训</a>、期待与您交流! ----------
package two;
public class test {
private static int max = 1000;
public static int getFactor(int m)
{
int count = 0;
while(m%5 == 0)
{
count++;
if(m >= 5)
{
m = m / 5;
}
}
return count;
}
public static int getNumber()
{
int count_5 = 0;
for(int i = 1;i<=max;i++)
{
count_5 += getFactor(i);
}
return count_5;
}
public static void main(String[] args)
{
System.out.println("1*2*...*1000 有 "+test.getNumber()+"个0");
}
}
------- <a href="http://www.itheima.com" target="blank">android培训</a>、<a href="http://www.itheima.com" target="blank">java培训</a>、期待与您交流! ----------