////////////////////////////////////////////////////////////////////////////////
//
// 05软件 jacklam
// 求阶乘尾数0的个数
// ex7.cpp
////////////////////////////////////////////////////////////////////////////////
#include "iostream.h"
///////////////////////////////////////////////////////////////////////////////
main()
{
int n=100;
int i,j,k;
int count=0;
j=n;
i=n/5; //求N含能被5除的个数
while(i--) //循环个数
{
k=j; //查找在当前数K能被5整除的个数
while(k%5==0)
{
k=k/5;
count++; //找到后就自加
}
j=j-5; //让其自减5,到下一个能被5整除的数
}
cout<<"the number of 0 in the end of "<<n<<"! is:"<<count<<endl;
return 1;
}