#include
#include
#include
#include
using namespace std;
long long int b,p,k;
long long int ans;
int main()
{
cin>>b>>p>>k;
cout<<b<<"^"<<p<<" “<<“mod”<<” “<<k<<”=";
ans=1;
while(p>0)
{
if(p%2==1)
{
ans=ansb%k;
//如果多了一就把它乘在答案上
}
b=bb%k;
p/=2;
}
cout<<ans%k;
return 0;
}
P1226 【模板】快速幂||取余运算题解
最新推荐文章于 2020-03-13 00:19:48 发布