#include <iostream>
using namespace std;
int countzero(int st,int dt)
{
int count=0;
int i;
for (i=st;i<=dt;++i)
{
int temp=i;
while (temp%5==0)
{
++count;
temp/=5;
}
}
return count;
}
int main()
{
int n;
cout<<"请输入n"<<endl;
cin>>n;
cout<<countzero(1,n)<<endl;
system("PAUSE");
return 0;
}
阶乘后面总共有多少个零
最新推荐文章于 2022-02-27 17:42:33 发布