标签:level bind alt mes iostream clipboard scan 内容 put
一个数N(1 <= N <= 10^9)
输出0的数量
5
1
数一下2和5的个数,取个数少的那个。
代码:
#include <iostream> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm> using namespace std; int n; int main() { scanf("%d",&n); int ans1 = 0,ans2 = 0; int d = 2; while(d <= n) { ans1 += n / d; d *= 2; } d = 5; while(d <= n) { ans2 += n / d; d *= 5; } printf("%d",min(ans1,ans2)); return 0; }
标签:level bind alt mes iostream clipboard scan 内容 put
原文地址:https://www.cnblogs.com/8023spz/p/10884188.html