标签:bsp clu ADG names copy 复制 ++ turn mat
不告诉你……
求出1!*2!*3!*4!*……*n!的末尾有几个零
输入格式:
n(n<=10^8)
输出格式:
有几个零
10
7
#include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<queue> using namespace std; long long n,t,ans,s; int main(){ scanf("%lld",&n); for(int i=1;i<=n;i++){ t=i; while(t%5==0){ s++; t/=5; } ans+=s; } printf("%lld",ans); return 0; }
标签:bsp clu ADG names copy 复制 ++ turn mat
原文地址:https://www.cnblogs.com/xiongchongwen/p/11163087.html