标签:span boa line data- scope 阶乘 hit names nbsp
第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 1000) 第2 - T + 1行:每行1个数N。(1 <= N <= 10^9)
共T行,输出对应的阶乘的长度。
3
4
5
6
2 3 3
#include <iostream> #include <cstdio> #include <cmath> #define MAX 50000 #define PI 3.1415926 using namespace std; int dp[MAX],n,d,c; int main() { int t; scanf("%d",&t); for(int i = 0;i < t;i ++) { scanf("%d",&n); printf("%lld\n",(long long)((log10(2 * PI * n) / 2 + n * (log10(n) - log10(exp(1))))) + 1); } }
标签:span boa line data- scope 阶乘 hit names nbsp
原文地址:https://www.cnblogs.com/8023spz/p/10015277.html