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