14 lines
255 B
C++
14 lines
255 B
C++
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int a[] = {1,2,3};
|
|
set<int> s(a,a+3);
|
|
set<int>::iterator iter;
|
|
if((iter = s.find(2)) != s.end())
|
|
{
|
|
cout<<*iter<<endl;//输出为2
|
|
}
|
|
return 0;
|
|
}
|