运行 ❯
建立属于
您自己的
网站
×
更改朝向
更改主题,深浅模式
移步至空间
#include <iostream> #include <list> using namespace std; int main() { // Create a list called cars that will store strings list<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; // Print list elements for (string car : cars) { cout << car << "\n"; } return 0; }
Volvo
BMW
Ford
Mazda