HDU 1124 Factorial
2012-05-31 16:05
495 查看
http://acm.hdu.edu.cn/showproblem.php?pid=1124
求n!末尾有多少个0,2*5出0,所以既求有多少个因子5
View Code
求n!末尾有多少个0,2*5出0,所以既求有多少个因子5
View Code
#include <iostream> using namespace std ; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); int ans=0; while(n) { n/=5; ans+=n; } printf("%d\n",ans); } return 0; }
相关文章推荐
- HDU 1124 Factorial&&nyoj 84 阶乘的 0【数学】
- hdu 1124 Factorial 数论,就是求一个数的阶乘的结果末尾有多少0.
- 【数学】 HDU 1124 Factorial
- hdu 1124 Factorial (快速求n!末尾0的个数)
- HDU 1124 Factorial (數論)
- HDU 1124 - Factorial (数学)
- hdu 1124 Factorial
- hdu 1124 Factorial(数论:推理)
- HDU 1124 Factorial 水题
- HDU 1124 Factorial
- hdu 1124 Factorial
- HDU 1124 Factorial (阶乘后缀0)
- HDU 1124 Factorial(简单数论)
- HDU:1124 Factorial
- HDU 1124 Factorial
- HDU - 1124 Factorial
- HDU 1124 Factorial(简单数论)
- HDU 1124 Factorial(数论)
- HDU 1124 Factorial (数论)
- 阶乘 hdu 1124 (Factorial)