直接秒好吧
2024-05-02 11:46:31
发布于:江苏
50阅读
0回复
0点赞
#include<bits/stdc++.h>
#include <functional>
using namespace std;
long long power(long long a,long long b,long long c){
if(b0){
return 1;
}
int t=power(a,b/2,c);
t=(long long)t*t%c;
if(b%21){
t=(long long)t*a%c;
}
return t;
}
int main(){
long long a,b,c;
cin>>a>>b>>c;
cout<<a<<"^"<<b<<" "<<"mod"<<" "<<c<<"="<<power(a,b,c);
}
这里空空如也
有帮助,赞一个