#include<stdio.h>
int pow_mod(int a,int b,int c)
{
int t
if(b==0)
return 1
if(b==1)
return a%c
t=pow(a,b/2,c)
t=t*t%c
if(b&1==1)
t=t*a%c
return t
}
int main()
{
int a,b,c
while(scanf("%d%d%d",&a,&b,&c)!=EOF)
{
printf("%d\n",pow_mod(a,b,c))
}
return 0
}
应该就是这样,现打的,没调试,应该过的了,要不行就把int改成__int64