标签:author pac syn back style mil weight sync git
///@date 9/26/2017
///@author Sycamore
///@link http://acm.hdu.edu.cn/showproblem.php?pid=1061
#include<bits/stdc++.h>
using namespace std;
long long powermod(long long a, long long b, long long m)
{
long long ret = 1;
while (b)
{
if (b & 1) ret = (ret*a)%m;
a = (a*a)%m; b >>= 1;
}
return ret;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin>>T;
while(T--)
{
long long n;
cin>>n;
cout<<powermod(n,n,10)<<‘\n‘;
}
}
标签:author pac syn back style mil weight sync git
原文地址:http://www.cnblogs.com/zjnu/p/7598919.html