W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
#include
#include
using namespace std; int main() { deque
cars = {"Volvo", "BMW", "Ford", "Tesla"}; // 在队列头部添加元素 cars.push_front("Audi"); // 在队列尾部添加元素 cars.push_back("VW"); // 打印队列元素 for (string car : cars) { cout << car << "\n"; } return 0; }