1
我要檢查是否有x
給定的點和y
值是一個點的矢量內:檢查點在內部矢量
bool inside_vector(int x, int y, vector<Point2i>& points)
{
for(vector<Point2i>::const_iterator it = points.begin();
it != points.end();
++it)
{
if(it->x == y && it->y == y)
{
return true;
}
}
return false;
}
是否有未經for
循環其他方法?