判断两个数组是否相等c++
介绍
模板不用多说,就是背。
注意:就是不能
,因为这样只是比较的数组的起始地址。if(path==temp)
源码
bool check(int path[], int temp[])
{
for (int i = 1; i <= n; i ++ )
{
if (path[i] != temp[i]) return false;
}
return true;
}
版权声明:
作者:Reid
链接:https://www.ricemoon.cn/algorithm/tmplate/72.html
来源:RiceMoon
文章版权归作者所有,未经允许请勿转载。
THE END
0
二维码
海报
判断两个数组是否相等c++
判断两个数组是否相等c++

共有 0 条评论