寒假集训附加题目题解报告(3)——阶乘的0有几个?
2013-01-19 21:26
260 查看
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2500
http://acm.sdut.edu.cn:8080/judge/contest/view.action?cid=5#problem/T
重题了。。
只要找5的个数就好,从开始累加。
http://acm.sdut.edu.cn:8080/judge/contest/view.action?cid=5#problem/T
重题了。。
#include "iostream" using namespace std; int main() { long int n,a,ans; cin>>n; while(n--) { ans = 0; cin>>a; while(a) { ans+=a/5; a/=5; } cout<<ans<<endl; } return 0; }
只要找5的个数就好,从开始累加。
相关文章推荐
- 寒假集训附加题目题解报告(8)——编码
- 寒假集训附加题目题解报告(1)——数列
- 寒假集训附加题目题解报告(2)——加减乘除
- 寒假集训附加题目题解报告(5)——求e
- 寒假集训附加题目题解报告(4)——3n+1数链长度问题
- 寒假集训附加题目题解报告(6)——数位根
- 寒假集训附加题目题解报告(7)——"数学好奇心"
- 【九度OJ】题目1179:阶乘 解题报告
- SDUT - 2017年寒假集训 阶段测试赛3(组队) -- 解题报告
- 2018年全国多校算法寒假训练营练习比赛题解(第三场)E进击吧!阶乘(大数运算)
- 2018年全国多校算法寒假训练营练习比赛(第五场)比赛题目题解
- 2018年全国多校算法寒假训练营练习比赛(第四场) 比赛题目题解
- ACM寒假集训部分题目总结
- 【九度OJ】题目1076:N的阶乘 解题报告
- 2015年nefu寒假集训结构体排序专题解题报告
- SDUT - 2017年寒假集训 阶段测试赛3(个人) -- 解题报告
- cogs 自己出的题目 题解报告
- 寒假训练报告1.18(贪心)
- 2.求任意数的阶乘尾数有几个0.
- [置顶] 【集训Day3 单调队列】【2018寒假集训Day 5更新】最大子序列和