#include <cstdio>
#include <iostream>
#include <cmath>
#define LL long long
#define debug(x) cout<<#x<<":"<<(x)<<endl;
using namespace std;
int main()
{
//freopen("1.txt", "r", stdin);
int tt;
int num;
scanf("%d", &tt);
while( tt-- )
{
scanf("%d", &num);
double x = num * log10((double)num);
double res = x - (long long)(x); //这里的x千万不要用int取整会丢失数据 1<=num<=1000,000,000
//double res1 = x - floor(x); //用floor是最保险的
int ans = (int)pow(10.0, res);
printf("%d\n", ans);
}
return 0;
}
HDU1060
最新推荐文章于 2022-10-10 13:55:56 发布