acm 英文翻译 数论568.pdf.pdfVIP

  • 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

文档评论(0)

1亿VIP精品文档

相关文档