vector<int> vec{3,4,8,4};
for(int &a : vec)
{
cout << a << endl;
}
map<string, string> m = {
{"S","Shang Hai"},
{"B","Bei Jing"},
{"G","Guang Zhou"}
};
for(auto &e : m){
cout << e.first << "-" << e.second << endl;
}
for(int &a : vec)
{
cout << a << endl;
}
map<string, string> m = {
{"S","Shang Hai"},
{"B","Bei Jing"},
{"G","Guang Zhou"}
};
for(auto &e : m){
cout << e.first << "-" << e.second << endl;
}
最新回答 / discaz
实验性代码有点bug,简单来说,我能不能使用opertaor-(double)重载函数能使得int类型的成员属性不改变,而double类型的属性取负值
2017-11-28