Created
September 15, 2018 10:15
-
-
Save completejavascript/ca409c5e279a07d1d53c983700392a4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
typedef unsigned long long ull; | |
int main() | |
{ | |
//freopen("input.txt","r",stdin); | |
ios::sync_with_stdio(false); | |
int Testcase, n; | |
cin >> Testcase; | |
for(int tc = 0; tc < Testcase; tc++) | |
{ | |
cin >> n; | |
ull count5 = 0, temp = 5; | |
while(true) | |
{ | |
ull t = n / temp; | |
if(t == 0) break; | |
count5 += t; | |
temp *= 5; | |
} | |
cout << count5 << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment