Skip to content

Commit 3da81d7

Browse files
author
lazylzg
committed
Update 6-10人见人爱A^B.cpp
1 parent 5f22e83 commit 3da81d7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

第6章数学问题/6.5快速幂/6-10人见人爱A^B.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ using namespace std;
66
*本题最终mod 1000
77
*/
88
int FastExponentiation(int a,int b,int mod) {
9-
//初始化为1
109
int answer=1;
1110
while(b!=0) {
12-
//不断将b转换为2进制
1311
if(b%2==1) {
1412
answer*=a;
1513
answer%=mod;
@@ -20,8 +18,6 @@ int FastExponentiation(int a,int b,int mod) {
2018
}
2119
return answer;
2220
}
23-
24-
2521
int main() {
2622
int a,b;
2723
while(scanf("%d%d",&a,&b)!=EOF) {

0 commit comments

Comments
 (0)