判斷STL容器中是否有某元素存在

vector vector<int> a; a.push_back(521); vector<int>::iterator it = find(a.begin(),a.end(),521); if(it != a.end()) cout<<"exist"<<endl; else cout<<"Not exist"<<endl; map/set set<int> s;//map相似 s.inse
相關文章
相關標籤/搜索