人见人爱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
", c);
	}
	
	return 0;
} 

  

原文地址:https://www.cnblogs.com/mjn1/p/11282834.html