[此贴子已经被作者于2021-10-18 20:07编辑过]
void dfs(int n,int s){ s=s+n; if(lch[n]){ dfs(lch[n],s); } if(rch[n]){ dfs(rch[n],s); } }