- 3
- 0
- 约1.76千字
- 约 1页
- 2017-06-03 发布于广东
- 举报
A CM Contest Problems Archive University of Valladolid SPAIN
Just the Facts
The expression N read as N factorial denotes the pro duct of the rst N p ositive integers where
N is nonnegative So for example
N N
0 1
1 1
2 2
3 6
4 24
5 120
10 3628800
For this problem you are to write a program that can compute the last nonzero digit of any factorial
for N For example if your program is asked to compute the last nonzero digit of
your program should pro duce 2 b ecause and is the last nonzero digit of
Input
Input to the program is a series of nonnegative integers not exceeding each on its own line with
no other letters digits or spaces For each integer N you should read the value and compute the last
nonzero digit of N
Output
For each integer input the program should print exactly one line of output Each line of output should
contain the value N rightjustied in columns through with leading blanks not leading zero es
Columns must contain - space hyphen greater space Column must contain the single
last nonzero digit of N
Sample Input
1
2
26
125
3125
9999
Sample Output
1 - 1
2 - 2
26 - 4
125 - 8
3125 - 2
9999 - 8
您可能关注的文档
- GB3894.6-84船舶布置图图形符号 救生设备.pdf
- GB3880-1997铝及铝合金轧制板材.pdf
- GB16169-2005 摩托车和轻便摩托车加速行驶噪声限.pdf
- GB15972-2008光纤第52部.pdf
- GB17794-2008柔性泡沫橡胶绝热制品.pdf
- GB17780-1999纺织机械安全要求.pdf
- GB18173.4-2010 高分子防水材料 第4部分:盾构法隧道管片用橡胶密封垫.pdf
- GB18173.3-2002高分子防水材料 第3部分-遇水膨胀橡胶.pdf
- GB18173.4-2010高分子防水材料 第4部分 盾构法隧道管片用橡胶密封垫.pdf
- gb18287蜂窝电话用锂离子电池总规范.pdf
- 某镇领导班子2025年度民主生活会对照检查材料.docx
- 高级中学党政办公室主任2025年度述职述廉报告.docx
- 在镇“锤炼作风提效能,凝心聚力建新功”主题春训活动动员部署会上的讲话.docx
- 在2026年春季开学教职工会议上的讲话.docx
- 公司党支部2025年度组织生活会对照检查材料.docx
- 在树立和践行正确政绩观学习教育动员部署会议上的讲话.docx
- 专题党课:筑牢作风“防火墙” 展现司法新担当.docx
- 在树立和践行正确政绩观学习教育专题研讨会上的发言材料.docx
- 在公司2026年度党建暨党风廉政大会上的讲话.docx
- 在县委党的建设工作领导小组会议上关于开展树立和践行正确政绩观学习教育部署工作的讲话.docx
原创力文档

文档评论(0)