hdu 2035
[cpp]#include<iostream>
#include<cstdio>
int main()
{
int a, b, res;
while(scanf("%d%d", &a, &b) != EOF && a+b){
res = 1;
for(int i = 1; i <= b; i++){
res = res*(a%1000)%1000;
}
printf("%d\n", res);
}
return 0;
}
/***********************
a*b ≡ (a%m)*(b%m) (mod m);
如果数据量比较大需要
用快速幂取模算法;
***********************/
补充:软件开发 , C++ ,