标签:can ret std int turn efi fine return while
#include<stdio.h>
#define M 1000000007
int fp(int a,int b){
long long ret=1,pow=a;//ret:返回值;pow:基底
while(b!=0){
if(b&1) ret=(ret*pow)%M;
pow=(pow*pow)%M;
b/=2;//相当于b>>1
}
return (int)ret;
}
int main(){
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",fp(a,b));
}
标签:can ret std int turn efi fine return while
原文地址:http://www.cnblogs.com/joeylee97/p/6128973.html