chore: import upstream snapshot with attribution
Awesome CI Workflow / Code Formatter (push) Waiting to run
Awesome CI Workflow / Compile checks (macOS-latest) (push) Blocked by required conditions
Awesome CI Workflow / Compile checks (ubuntu-latest) (push) Blocked by required conditions
Awesome CI Workflow / Compile checks (windows-latest) (push) Blocked by required conditions

This commit is contained in:
wehub-resource-sync
2026-07-13 12:37:28 +08:00
commit 29cfe479ab
432 changed files with 68491 additions and 0 deletions
@@ -0,0 +1,58 @@
#include <iostream>
using std::cin;
using std::cout;
int queue[10];
int front = 0;
int rear = 0;
int count = 0;
void Enque(int x) {
if (count == 10) {
cout << "\nOverflow";
} else {
queue[rear] = x;
rear = (rear + 1) % 10;
count++;
}
}
void Deque() {
if (front == rear) {
cout << "\nUnderflow";
}
else {
cout << "\n" << queue[front] << " deleted";
front = (front + 1) % 10;
count--;
}
}
void show() {
for (int i = 0; i < count; i++) {
cout << queue[(i + front) % 10] << "\t";
}
}
int main() {
int ch, x;
do {
cout << "\n1. Enque";
cout << "\n2. Deque";
cout << "\n3. Print";
cout << "\nEnter Your Choice : ";
cin >> ch;
if (ch == 1) {
cout << "\nInsert : ";
cin >> x;
Enque(x);
} else if (ch == 2) {
Deque();
} else if (ch == 3) {
show();
}
} while (ch != 0);
return 0;
}