89. a^b

题目地址:https://www.acwing.com/problem/content/description/91/

AC代码

#include 

using namespace std;

long long fastPower(long long a, long long b,int mod) {
    long long res = 1;
    while (b > 0) {
        if (b & 1) 
            res = res * a % mod;
        b >>= 1;
        a = (a * a) % mod;
    }
    return res % mod;
}

int main(){
    int a,b,p;
    cin>>a>>b>>p;
    cout<

总结

ACM的hello world
答案参考:https://blog.csdn.net/qq_19782019/article/details/85621386

你可能感兴趣的:(89. a^b)