首页 > 代码库 > HDU 1018

HDU 1018

运用斯特林公式。。。。。--!

 

#include <algorithm>#include <cstdio>#include <cstring>#include <iostream>#include <cmath>#define PI 3.141592653#define E 2.71828182using namespace std;int main(){	int T; double n;	scanf("%d",&T);	while(T--){		scanf("%lf",&n);		int ans=(int)(log10(2*PI*n)/2+n*log10(n/E));		printf("%d\n",ans+1);	}	return 0;}

  

HDU 1018