运行 ❯
获取您的
自有
网站
×
更改方向
更改主题,深色/浅色
转到 Spaces
#include <iostream> #include <set> using namespace std; int main() { // Create a set with two equal elements (BMW is listed two times) set<string> cars = {"Volvo", "BMW", "Ford", "BMW", "Mazda"}; // Print set elements for (string car : cars) { cout << car << "\n"; } return 0; }
BMW
福特
马自达
沃尔沃