Sunday, October 13, 2019

Dimik oj - 12 ফ্যাক্টরিয়াল 100

#include < iostream >
using namespace std;
int main() {
    int n, t;
    cin >> n;
    while(n--) {
        cin >> t;
        int ans = 0;
        while(t > 0) {
            ans += t/5;
            t/=5;
        }
        cout << ans << endl;
    }
    return 0;
}

No comments: