运用数组进行2的N次方进行运算
#include<iostream>
using namespace std;
const int N = 643010;
int main()
{
int arr[N]={1};
int n;
cin>>n;
int m=1;
for (int i = 0;i < n; i ++ )
{2
int t = 0;
for (int j = 0; j < m; j ++ )
{
t += arr[j] * 2;
arr[j] = t % 10;
t /= 10;
}
if (t) arr[m ++ ] = 1;
}
for (int i = m - 1; i >= 0; i -- ) cout << arr[i];
cout << endl;
return 0;
}