[添加链接描述](http://acm.hdu.edu.cn/showproblem.php?pid=2035)#include<stdio.h>
#include<math.h>
int main(void)
{
int a,b,i,res;
while(scanf("%d %d",&a,&b)!=EOF&&a!=0&&b!=0){
res=a;
for(i=2;i<=b;i++){
res=res*a%1000;
}
printf("%d\n",res);
}
return 0;
}
01-17