2011-12-14 05:37:29
地址:http://acm.hdu.edu.cn/showproblem.php?pid=2035
题意:中文。。。还用不上快速幂。
代码:
# include <stdio.h>
int main ()
{
int n, m, mul ;
while (~scanf ("%d%d", &n, &m) && (m||n))
{
mul = 1 ;
while (m--) mul = (mul * n) % 1000 ;
printf ("%d\n", mul) ;
}
return 0 ;
}