运行 ❯
获取
自己的
网站
×
更改方向
更改主题,深色/浅色
前往 Spaces
#include <iostream> #include <list> using namespace std; int main() { list<string> cars = {"Volvo", "BMW", "Ford", "Mazda"}; // Change the value of the first element cars.front() = "Opel"; // Change the value of the last element cars.back() = "Toyota"; cout << cars.front() << "\n"; cout << cars.back() << "\n"; return 0; }
欧宝
丰田