方法一:
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string.h>
#include<cstdio>
#include<queue>
#include<cmath>
using namespace std;
#define ll long long signed main()
{
int T;
cin>>T;
while(T--)
{
ll n;
cin>>n;
ll x=n*log10(n);
ll ans=pow(10,n*log10(n)-x);
cout<<ans<<endl;
}
return 0;
方法二:
#include<iostream>
#include<cstring>
#include<string.h>
#include<cstdio>
#include<cmath>
int main()
{
int n,res;
double b;
scanf("%d",&n);
b=n*log10(1.0*n); //求A.B
b=b-(int)b; //求0.B
res=(int)pow(10.0,b); //求10^0.B的整数部分
printf("%d\n",res);
return 0;
}