题目:http://acm.hdu.edu.cn/showproblem.php?pid=2035
#include<stdio.h>
int main()
{
int a,b,c,i;
while(scanf("%d %d",&a,&b)!=EOF)
{
if(a==0&&b==0)
return 0;
c=1;
for(i=1;i<=b;i++)
{
c=c*a%1000;
}//防止数据超出范围;
printf("%d\n",c);
}
return 0;
}