zoj 2277 The Gate to Freedom


            N^N = X

  --->    Nlog10(N) = log10( X )

 ---->    X的最高位为 Nlog10(N) 小数部分的第一个非0位


      

#include<stdio.h>
#include<math.h>

int main(void)
{
	double n;
	while(scanf("%lf",&n) != EOF)
	{
		n = n*log10(n);
		n = n - (long long int)n;
		n = pow(10,n);
		while((int)n == 0)
			n *= 10;
		printf("%d
",(int)n);
	}
	return 0;
}


原文地址:https://www.cnblogs.com/riskyer/p/3262944.html