题目描述
代码
#include <iostream>
#include <vector>
using namespace std;
bool value_Exist(vector<int>::const_iterator begin, vector<int>::const_iterator end, int i);
int main()
{
int i;
cin >> i;
vector<int> s = { 1,2,3,4,5,6,7,8,9,10,11,12 };
bool a;
a = value_Exist(s.begin(), s.end(), i);
cout << a;
return 0;
}
bool value_Exist(vector<int>::const_iterator begin, vector<int>::const_iterator end, int i)
{
for (; begin != end; ++begin)
{
if (*begin == i)
{
return true;
}
}
return false;
}