标签:
#include <stdio.h>
long long quickPow(long long a, long long b)///快速幂, a的b次方
{
long long c = 1;
while(b)
{
if(b&1)c=c*a;
b=b/2;
a=a*a;
}
return c;
}
int main()
{
long long a, b;
while(scanf("%lld %lld", &a, &b) != EOF)
{
long long ans = quickPow(a, b);
printf("%lld\n", ans);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/zznulw/p/5326004.html