#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,p;
cin>>a>>b>>p;
int res=1;
while(b)
{
int t=a%p;
if(b&1) res=(res*t)%p;
a=t*t%p;
b>>=1;//b右移
}
cout<<res<<endl;
return 0;
}
快速取模指数
猜你喜欢
转载自blog.csdn.net/salmonwilliam/article/details/88840871
今日推荐
周排行