title

快速幂

#include<cstdio>
#define int long long
int a,b,p;
inline double power(int a,int b){
	int ans=1;
	for(;b;b>>=1){
		if(b&1)	ans=ans*a;
		a=a*a;
	}
	return ans;
}
signed main(){
	scanf("%lf%lf",&a,&b);
	printf("%lf",power(a,b));
	return 0;
}
posted @ 2018-09-10 01:25  Horrigue_JyowYang  阅读(65)  评论(0编辑  收藏  举报