poj1401

简单题

#include <cstdio>
using namespace std;

int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        long long n;
        scanf("%lld", &n);
        long long temp = 5;
        long long ans = 0;
        while (temp <= n)
        {
            ans += n / temp;
            temp *= 5;
        }
        printf("%lld\n", ans);
    }
    return 0;
}
View Code

 

posted @ 2013-06-12 16:44  undefined2024  阅读(122)  评论(0编辑  收藏  举报