#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
int a,b, c;
cin >> a >> b >> c;
int m = 1;
//因为乘法运算规则得: (a*b) % p = ((a%p)*b)%p 或 ((a%p)*(b%p))%p
for(int i=1; i<=b; i++)
m = (m*a)%c;
cout << m << endl;
system("pause");
return 0;
}
1294. 高级机密(求高次幂的模)
最新推荐文章于 2025-06-26 13:26:05 发布
