标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1018
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27548 Accepted Submission(s): 12526
1 #include <cstdio> 2 #include <cmath> 3 using namespace std; 4 5 int main () 6 { 7 int n,m,i; 8 double sum; 9 scanf ("%d",&n); 10 while (n--) 11 { 12 scanf ("%d",&m); 13 sum = 0; 14 for (i=1; i<=m; i++) 15 { 16 sum += log10((double)i); 17 } 18 printf ("%d\n",(int)sum+1); 19 } 20 return 0; 21 }
标签:
原文地址:http://www.cnblogs.com/dxd-success/p/4242478.html