标签:div amp color turn while class ret bsp span
返回 a^b mod c 的值
1 int montgomery(int a, int b, int c) 2 { 3 int ans = 1; 4 while (b) { 5 if (b & 1) 6 ans = ans * a % c; 7 b >>= 1; 8 a = a * a % c; 9 } 10 return ans; 11 }
标签:div amp color turn while class ret bsp span
原文地址:http://www.cnblogs.com/ghcred/p/7436732.html