HDU/2034/2035/main.c
Saturneric 0525ffad24 Add.
2020-09-01 00:48:58 +08:00

17 lines
242 B
C

#include <stdio.h>
int main(void){
int a, b, c = 1000, t = 1;
a = a % c;
while(scanf("%d %d",&a,&b) == 2 && a+b){
t = 1;
while(b != 0){
if(b & 1) t = t * a % c;
b >>= 1;
a = a * a % c;
}
printf("%d\n",t);
}
return 0;
}