Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: C++ 中的向量迭代
我只是想弄清楚如何遍历两个向量并比较数据。编写一个程序,该程序将获取正确的测验答案并与学生的答案进行比较以确定它们是否正确。我对使用迭代器以及如何在这种情况下应用它们感到困惑。任何人都可以帮忙吗?谢谢!
std::vector<int> students=get_selections(); //or whatever std::vector<int> correct=get_cor... bool is_equal=std::equal(students.begin(), students.end(), correct.begin());