大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE稳定放心使用
注意find不属于vector的成员,而存在于算法中,应加上头文件#include <algorithm>:
#include <vector>
#include <algorithm>
#include <iostream>
int main( )
{
using namespace std;
vector<int> L;
L.push_back( 1 );
L.push_back( 2 );
L.push_back( 3 );
vector<int>::iterator result = find( L.begin( ), L.end( ), 3 );
if ( result == L.end( ) )
cout << “No” << endl;
else
cout << “Yes” << endl;
}
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/182007.html原文链接:https://javaforall.net