#include "bits/stdc++.h"
using namespace std;
#define LL long long
#define INF 0x3f3f3f3f3f
#define PI acos(-1)
#define N 510
#define MOD 10
LL quickPow(LL a,LL b)
{
    LL ans=1;
    while(b>0){
        if(b&1){
            ans=ans*a%MOD;
        }
        b>>=1;
        a=a*a%MOD;
    }
    return ans;
}
int main()
{
    int n,k;
    while(~scanf("%d",&n)){
        printf("%lld\n",quickPow(n,n));
    }
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2021-10-22
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-11-01
  • 2021-08-31
相关资源
相似解决方案