标签:hdu scanf 数学 iostream pac while 五个 using problem
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1124
思路:每五个数1个0,5个5就2个0(不用管2,一定充足)
#include<iostream> #include<cstdio> #include<cmath> using namespace std; typedef long long LL; int main(void) { LL n,j; int tim,ans,t,i; scanf("%d",&t); while(t--) { scanf("%lld",&n); j=1;tim=0; while(j<=n) { j*=5;tim++; } ans=0; for(i=1;i<tim;i++) { ans+=n/pow(5,i); } printf("%d\n",ans); } return 0; }
标签:hdu scanf 数学 iostream pac while 五个 using problem
原文地址:https://www.cnblogs.com/2018zxy/p/9903589.html