题目:http://acm.hdu.edu.cn/showproblem.php?pid=1097
#include <bits/stdc++.h>//万能开头;
using namespace std;
int main()
{
int a,b,c;
while(scanf("%d %d",&a,&b)!=EOF)
{
while(a>=10)
a%=10;
b=b%4;
if(b==0)
b=4;
c=pow(a,b);
while(c>=10)
c%=10;
printf("%d\n",c);
}
return 0;
}