早教吧 育儿知识 作业答案 考试题库 百科 知识分享

这个函数这么写对不对,能不能这样传参数.boolFindEdge(vectorms,intxx,intyy)//判断是否已经有这个边了,//存在了返回true,不存在返回false{for(vector::iteratorshiyan=ms.begin();shiyan!=ms.end();++shiyan){if((*shiyan

题目详情
这个函数这么写对不对,能不能这样传参数.
bool FindEdge(vector ms,int xx,int yy)//判断是否已经有这个边了,//存在了返回true,不存在返回false
{
for(vector::iterator shiyan=ms.begin();shiyan!=ms.end();++shiyan)
{
if((*shiyan).x==xx&&(*shiyan).y==yy)
return true;
}
return false;
}
▼优质解答
答案和解析
bool FindEdge(vector &ms,int xx,int yy)
改成用引用参数,效率高点
看了 这个函数这么写对不对,能不能...的网友还看了以下: