#include
using namespace std;
size_t repeatMod(size_t base, size_t n, size_t mod)
{
size_t a = 1;
while(n)
{
if(n&1)
{
a = (a*base)%mod;
}
base = (base*base)%mod;
n = n>>1;
}
return a;
}
int main()
{
int ret = repeatMod(44,36,97);
printf("%d
",ret);
return 0;
}
结果为75,这里借用别人的图片解释一下