阶乘位数

#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string.h>
#include<algorithm>
using namespace std;

int main()
{
    int t,n;
    cin>>t;
    while(t--)
    {
        double sum=1;
        cin>>n;
        for(int i=1;i<=n;i++)
            sum+=log10(i);
        printf("%d
",(int)sum);
    }
    return 0;
}
anytime you feel the pain.hey,refrain.don't carry the world upon your shoulders
原文地址:https://www.cnblogs.com/gaoss/p/5316432.html