#include
#include
using namespace std;
template
T1 findInt(T1 t1,T1 t2, T2 val)
{
while (t1 != t2) {
if ((*t1)== val)
break;
else
t1++;
}
return t1;
}
int main()
{
int a[7]={1,2,3,4,5,6,7};
vector vect(a,a+7);
cout<<"enter the find val:";
int val;
cin>>val;
vector::iterator iter;
iter=findInt(vect.begin(),vect.end(),val);
if (iter != vect.end())
cout<
else
cout<
getchar();
getchar();
return 0;
}
阅读(306) | 评论(0) | 转发(0) |