#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void main()
{
vector<string>StrArr;
StrArr.push_back("xyz");
StrArr.push_back("ok");
StrArr.push_back("wocow3");
if(find(StrArr.begin(),StrArr.end(),string("ok")) != StrArr.end())
cout<<"finded"<<endl;
else
cout<<"not find"<<endl;
}
转载于:https://www.cnblogs.com/riky/archive/2007/03/24/686715.html