容器查询问题
#include <iostream>#include <vector>/****为什么查不了?****/using namespace std;bool intReturn(vector<int>::iterator it, vector<int>::iterator iter, int num){ while(it != iter) { if(*it == num) { return true; } else { return false; } ++it; }}int main(){ vector<int> text; int word; while(1) { cin >> word; if(word == 0) { break; } text.push_back(word); } int number; cout << "输入要查询的整数: "; cin >> number; vector<int>::iterator it = text.begin(); vector<int>::iterator iter = text.end(); bool vec; vec = intReturn(it, iter, number); if(vec == true) { cout << "查找到了" << endl; } else { cout << "没有这个数" << endl; } return 0;}