Z(N) is the number of zeros at the end of the decimal form of number N!
求n!中末尾0的个数,转化为n中有几个5.
#include <cstdio> int main() { int n, sum, i, t; scanf("%d",&t); while(t--) { scanf("%d",&n); for(sum=0,i=5;i<=n;i*=5) sum+=n/i; printf("%d\n",sum); } return 0; }