http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2500

思维呀 亲

代码:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#define LL long long
using namespace std;
int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        LL n;
        cin>>n;
        LL ans=0;
        LL tmp=5;
        while(tmp<=n)
        {
            ans+=(n/tmp);
            tmp*=5;
        }
        cout<<ans<<endl;
    }
    return 0;
}

  

posted on 2012-12-10 17:19  夜->  阅读(127)  评论(0编辑  收藏  举报