人见人爱A^B

#include <cstdio>

int main()
{
	int a, b, c;
	while(scanf("%d %d", &a, &b) && (a != 0 || b != 0))
	{
		c = 1;
		for(int i = 0; i < b; ++ i)
		{
			c = c * a % 1000;
		}
		printf("%d\n", c);
	}
	
	return 0;
} 

  

posted @ 2019-08-01 15:21  青衫客36  阅读(99)  评论(0编辑  收藏  举报