#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
int n;
int main() {
while(~scanf("%d",&n))
printf("%d\n",(int)pow(10,n*log10(n)-(int)(n*log10(n))));
return 0;
}
快速幂暴力
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#define ll long long
using namespace std;
double pow(double a,int b){
double ans=1;
while(b){
if(b&1){
ans=ans*a;
}
a=a*a;
while(a<0.01)a*=10;
b>>=1;
}
return ans;
}
int main() {
int n;
while(~scanf("%d",&n)){
double t=n;
while(t>=1)t/=10;
double ans=pow(t,n);
while(ans<1)ans*=10;
printf("%d\n",(int)ans);
}
return 0;
}