额……
//公式
//log10(1)+log10(2)+···+long10(n)取整后加1
#include <stdio.h>
#include <math.h>
int main()
{
int cas;
scanf("%d",&cas);
while (cas--)
{
long i,n;
double sum=1.0;
scanf("%ld",&n);
for (i=1;i<=n;i++)
sum+=log10(i);
printf("%ld\n",(long)sum);
}
return 0;
}
[[it] 本帖最后由 StarWing83 于 2008-5-7 21:36 编辑 [/it]]