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.
#include <iostream> using std::set; using std::cout; using std::endl;
报错:
Josephus_Permutation.cpp:3:13: error: ‘std::set’ has not been declared
不应该std::set是命名空间的 STLstd吗?
std::set
std
它位于std命名空间中,但您需要包含适当的标头:
#include <set>
标<iostream>头仅包含标准输入/输出库,其中包括std::cout和std::endl. std::set但是,在 中定义<set>。
<iostream>
std::cout
std::endl
<set>