MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

CodeChef_problems/Factorial/solution.cpp:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include<bits/stdc++.h>
13using namespace std;
14int main(){
15 int t;
16 cin >> t;
17 while(t--){ //running for all number of testcases
18 int num, x=5;
19 cin >> num;
20 long long int ans = 0;
21 while (num/x!=0){//checking while the number contains multiples of x (any power of 5)
22 ans = ans + num/x;
23 x = x*5;//next power of 5
24 }
25 cout << ans << "\n";
26 }
27}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected