#include<iostream>
using namespace std;
int main()
{
int t,m;
long n;
while (cin >> t)
{
while (t--&&cin >> n)
{
if (n > 10)
m = n % 10;
else m = n;
m = pow(m, n);
m = m % 10;
cout << m << endl;
}
}
return 0;
}
1061 Rightmost Digit
最新推荐文章于 2018-08-27 17:10:47 发布