#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdlib.h>
#include<queue>
#include<map>
#include<iomanip>
#include<math.h>
const int INF = 0x3f3f3f3f;
using namespace std;
typedef long long ll;
typedef double ld;
const int N=1e6+10;
int nbit;
int ans[N];
void init()
{
nbit = 1;
ans[0] = 1;
}
void mul(int num)
{
int temp_add = 0;
int temp_mul = 0;
for(int i = 0; i < nbit; i ++ )
{
temp_mul = num * ans[i];
ans[i] = (temp_mul + temp_add) % 10;
temp_add = (temp_mul + temp_add) / 10;
}
while(temp_add)
{
ans[nbit ++ ] = temp_add % 10;
temp_add /= 10;
}
}
void exp(int b, int e)
{
for(int i = 0; i < e; i ++ )
mul(b);
}
void vout()
{
for(int i = nbit - 1; i >= 0; i -- )
printf("%d", ans[i]);
printf("\n");
}
int t, n,m;
int main(){
while(~scanf("%d %d", &m,&n))
{
init();
exp(m, n);
vout();
}
return 0;
}
标签:temp,大数,int,add,数组,ans,mul,include,模拟 From: https://blog.51cto.com/u_15952369/6035451