N的阶乘末尾0个数

#include<stdio.h>
#define LL long long
int main()
{

    LL n,ans;
    while(scanf("%lld",&n)!=EOF)
    {
        ans=0;
        while(n)
        {
            ans+=n/5;
            n/=5;
        }
        printf("%lld\n",ans);
    }
}
posted @ 2018-03-18 14:18  KuroNekonano  阅读(141)  评论(0)    收藏  举报