版权声明:本文为博主原创文章,未经博主同意不得转载。 https://blog.csdn.net/u013497151/article/details/27633731
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int pow(int x, int n)
{
int result = 1;
while (n > 0)
{
if (n % 2==1)
result *= x;
x *= x;
n /=2 ;
}
return result;
}
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m))
{
int s = pow(n,m);
printf("%d
",s);
}
return 0;
}