2012年5月22日

Find the sum of digits in n!

摘要: Find the sum of digits in n!Time Limit:2000MSMemory Limit:65535KBSubmissions:192Accepted:41Descriptionn! meansn*(n1) *... *3 *2 *1Find the sum of the digits in the number n!Inputone line: n (1<n<=10000)Outputthe sum of the digits in the number n!Sample Input10Sample Output27Hint10! =36288003+6 阅读全文

posted @ 2012-05-22 19:20 即为将军 阅读(342) 评论(0) 推荐(0)

N!

摘要: N!Time Limit:5000MSMemory Limit:65535KBSubmissions:96Accepted:26DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file.OutputFor each N, output N! in one line.Sample Input123Sample Output126解法一://用大整数想乘的方法# include<iostream> 阅读全文

posted @ 2012-05-22 18:57 即为将军 阅读(260) 评论(0) 推荐(0)

导航