随缘更新
输出数据中间有空格
for (int i = 0; i < n.length(); i++) {
if(i!=0) cout<<' ';
cout << number[n[i] - '0'];
}
遍历map
map<int,int> m;
// 方法一
map<int,int>::iterator iter;
while(iter != m.end()){
cout << iter->first << "-" << iter->second << endl;
iter++;
}
//方法二
for(auto &it : m){
cout << it.first << "-" << it.second <<endl;
}