#include <algorithm>
#include <string>
#include <set>
using namespace std;
int main()
{
set<string> m;
m.insert("hello");
m.insert("hello2");
m.insert("hello3");
if (find(m.begin(), m.end(), "hello") == m.end())
cout << "no" << endl;
else
cout << "yes" << endl;
string s("1a2b3c4d5e6f7g8h9i1a2b3c4d5e6f7g8ha9i");
string flag;
string::size_type position;
position = s.find("jk");
if (position != s.npos)
{
cout << "position is : " << position << endl;
}
else
{
cout << "Not found the flag" + flag;
}
}
近期评论