mirror of
https://github.com/krahets/hello-algo.git
synced 2026-06-29 17:14:38 +00:00
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
This commit is contained in:
@@ -6,36 +6,36 @@
|
||||
|
||||
#include "../utils/common.hpp"
|
||||
|
||||
/* ドライバーコード */
|
||||
/* Driver Code */
|
||||
int main() {
|
||||
/* キューを初期化 */
|
||||
queue<int> queue;
|
||||
|
||||
/* 要素エンキュー */
|
||||
/* 要素をエンキュー */
|
||||
queue.push(1);
|
||||
queue.push(3);
|
||||
queue.push(2);
|
||||
queue.push(5);
|
||||
queue.push(4);
|
||||
cout << "Queue queue = ";
|
||||
cout << "キュー queue = ";
|
||||
printQueue(queue);
|
||||
|
||||
/* 先頭要素にアクセス */
|
||||
/* キュー先頭の要素にアクセス */
|
||||
int front = queue.front();
|
||||
cout << "Front element of the queue front = " << front << endl;
|
||||
cout << "先頭要素 front = " << front << endl;
|
||||
|
||||
/* 要素デキュー */
|
||||
/* 要素をデキュー */
|
||||
queue.pop();
|
||||
cout << "Element dequeued = " << front << ", after dequeuing";
|
||||
cout << "取り出した要素 front = " << front << "、取り出し後の queue = ";
|
||||
printQueue(queue);
|
||||
|
||||
/* キューの長さを取得 */
|
||||
int size = queue.size();
|
||||
cout << "Length of the queue size = " << size << endl;
|
||||
cout << "キューの長さ size = " << size << endl;
|
||||
|
||||
/* キューが空かどうかを判定 */
|
||||
bool empty = queue.empty();
|
||||
cout << "Is the queue empty = " << empty << endl;
|
||||
cout << "キューが空かどうか = " << empty << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user