teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

リンク追加

2020/04/22 03:19

投稿

SHOMI
SHOMI

スコア4079

answer CHANGED
@@ -9,4 +9,6 @@
9
9
 
10
10
  std::deque<int> d;
11
11
  d.pop_front();
12
- ```
12
+ ```
13
+
14
+ どのようなコンテナがあるか、一度[コンテナライブラリ](https://cpprefjp.github.io/reference.html#container)を眺めてみるとよいでしょう。

1

リンク追加、先頭要素削除追記

2020/04/22 03:19

投稿

SHOMI
SHOMI

スコア4079

answer CHANGED
@@ -1,1 +1,12 @@
1
- `std::vector`,`std::list`,`std::deque`等お好にどうぞ
1
+ [`std::vector`](https://cpprefjp.github.io/reference/vector/vector.html),[`std::list`](https://cpprefjp.github.io/reference/list/list.html),[`std::deque`](https://cpprefjp.github.io/reference/deque/deque.html)いずれも`push_back()`でます
2
+ 先頭要素の削除は
3
+ ```C++
4
+ std::vector<int> v;
5
+ v.erase(v.begin());
6
+
7
+ std::list<int> l;
8
+ l.pop_front();
9
+
10
+ std::deque<int> d;
11
+ d.pop_front();
12
+ ```