题解p1046这道题是模拟,所以十分简单; 不必多说,直接上代码: #include<bits/stdc++.h> using namespace std; const int N=1e2+10; int a[N]; //树的高度; int main(){ int n;//能够到的高度; in…