#include <iostream>
#include <vector>
using namespace std;
using std::vector;
bool findNumber(vector<int>::iterator begin, vector<int>::iterator end, int target)
{
while (begin != end) {
if ((*begin) == target) {
return true;
}
++begin;
}
return false;
}
int main()
{
vector<int> num = { 0,1,3,4,5,6,7,8,9,11,12,15 };
if (findNumber(num.begin(), num.end(), 5)) {
std::cout << "it is found" << std::endl;
}
else
{
cout << "it is not found" << endl;
}
system("pause");
return 0;
}
07-15
07-15
07-13
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交