111
2026-08-30 14:53:02
发布于:北京
#include<bits/stdc++.h>
using namespace std;
int n;
const int N=1e5+5;
int a[N];
void dfs(int x){
if(2x<=n)dfs(2x);
if(2x+1<=n)dfs(2x+1);
cout << a[x] << " ";
}
int main(){
cin >> n;
for(int i=1;i<=n;i++)cin >> a[i];
dfs(1);
return 0;
}
这里空空如也












有帮助,赞一个