由网友(执手浪天涯)分享简介:您给出两个数组以了解它们是否相等?You are given two arrays to find out if they are equal?要解决它的方法之一是使用哈希表。使用哈希表我怎样才能做到这一点?One way to solve it is to use a hash table. How can I...
您给出两个数组以了解它们是否相等?
You are given two arrays to find out if they are equal?
要解决它的方法之一是使用哈希表。使用哈希表我怎样才能做到这一点?
One way to solve it is to use a hash table. How can I accomplish this using a hash table?
推荐答案
使用的std ::阵列
:
std::array<int, 3> var = {{ 1, 2, 3 }},
bar = {{ 4, 5, 6 }};
baz = {{ 1, 2, 3 }};
std::cout << std::boolalpha << (var == baz) // true
<< (bar == baz); // false
相关推荐
最新文章