[恢]hdu 2035

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 ;
}



posted @ 2012-01-06 14:45  Seraph2012  阅读(110)  评论(0编辑  收藏  举报