map

map<int,int> mp;
mp[x]=y;
mp[1]=2;
for(auto[x,y] : mp) {
    cout << x << " " << y << "\n";
}
mp.erase(1);
cout << mp.size() << "\n";
mp.clear();
mp.count(x) ? "yes” : “no”
 /*
x y
1 2
*/
posted @ 2025-07-07 17:23  dingchenjun  阅读(10)  评论(1)    收藏  举报