changeData(list){let lv1list=[];for(let i=0;i<list.length;i++){let lv1=list[i].VALUE.length/3-1;if(!lv1list[lv1]){
lv1list[lv1]={}}
lv1list[lv1][list[i].VALUE]=({"value":list[i].VALUE,"label":list[i].NAME})}let parmap=null;let submap=null;for(let j=lv1list.length-2;j>=0;j--){//从倒数第二级开始
parmap=lv1list[j]
submap=lv1list[j+1]for(let k in parmap){for(let m in submap){if(m.startsWith(k)){if(!parmap[k].children){
parmap[k].children=[]}
parmap[k].children.push(submap[m])}}}}let result=[]for(let p in lv1list[0]){
result.push(lv1list[0][p])}return result
},
#include<bits/stdc.h>
using namespace std;
int main()
{string s[25];//string类数组 int n;cin >> n;for(int i 1; i < n; i)cin >> s[i];sort(s1, s1n);//默认升序 调用函数默认排序 for(int i 1; i < n; i)cout << s[i] << endl;…