http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2500
思维呀 亲
代码:
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<map> #include<vector> #include<stack> #include<queue> #include<algorithm> #define LL long long using namespace std; int main() { int T; cin>>T; while(T--) { LL n; cin>>n; LL ans=0; LL tmp=5; while(tmp<=n) { ans+=(n/tmp); tmp*=5; } cout<<ans<<endl; } return 0; }