提交时间:2024-04-19 16:57:53

运行 ID: 45718

#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[100]; memset(a,0,sizeof(a)); a[0] = 1; int m = 1; for(int j = 1; j <= n; j++) { int t = 0; for(int j = 0; j < m; j++) { t += a[j] * 2; a[j] = t % 10; t /= 10; } if(t > 0) a[m++] = 1; } for(int i = m-1; i >= 0; i--) { cout << a[i]; } return 0; }