HDU 1124 Factorial 水题
2012-12-04 22:01
405 查看
题意:统计n!后面有几个0, 2肯定够用,只要算n!里有几个5就可以了
View Code
View Code
#include<cstdio> #include<cstring> int main() { int cas, n; scanf("%d", &cas); while(cas--) { scanf("%d", &n); int s = 5, ans = 0; while(s <= n) ans += n/s, s *= 5; printf("%d\n", ans); } return 0; }
相关文章推荐
- hdu 1124 Factorial(末尾0)
- HDU 1124 Factorial
- HDU 1124 Factorial
- HDU 1124 Factorial (阶乘后缀0)
- 【HDU】 1124 Factorial
- Hdu - 1124 - Factorial
- HDU 1124 Factorial
- HDU 1124 Factorial (数论)
- 杭电OJ——1124 Factorial(水题)
- hdu1124-Factorial
- HDU 1124 Factorial (數論)
- HDU - 1124 Factorial
- HDU 1124 Factorial(数论)
- HDU 1124 Factorial&&nyoj 84 阶乘的 0【数学】
- hdu 1124 Factorial 数论,就是求一个数的阶乘的结果末尾有多少0.
- hdu 1124 Factorial(数论:推理)
- HDU 1124 Factorial
- HDU 1124 Factorial(简单数论)
- hdu 1124 Factorial
- hdu 1124 Factorial