HDU 1124 - Factorial

思路

被做烂的题了。

代码

int main()
{
    LL n;
    int T;
    cin >> T;
    while (T--)
    {
        LL ans = 0;
        cin >> n;
        while (n)
        {
            ans += n / 5;
            n /= 5;
        }
        cout << ans << endl;
    }
    return 0;
}

Powered by Jekyll and Theme by solid