运行 ❯
获取您的
自己的
网站
×
更改方向
更改主题,亮/暗
转至空间
#include <iostream> #include <set> using namespace std; int main() { // Create a set called cars that will store strings set<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; // Remove all elements from the set cars.clear(); // Print set elements for (string car : cars) { cout << car << "\n"; } return 0; }