-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (45 loc) · 812 Bytes
/
main.cpp
File metadata and controls
50 lines (45 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Name: Joowon Byun
// Date: July 22th 2015 ~ July 27th 2015
//
#include <iostream>
#include <stdlib.h>
#include "Queue.h"
using namespace std;
int menu() {
int a;
cout << "Select" << endl;
cout << "[1] insert" << endl;
cout << "[2] pop" << endl;
cout << "[3] list" << endl;
cout << "[4] exit" << endl;
cout << "Your choice? : ";
cin >> a;
return a;
}
void choice() {
Queue<int> *q = new Queue<int> ();
int in, choice;
while(1) {
choice = menu();
if (choice == 1) {
cout << "Type an input :";
cin >> in;
q->pushRear(in);
cout << endl;
}
else if (choice == 2) {
q->popFront();
}
else if (choice == 3) {
q->listFromFront();
}
else if (choice == 4) {
exit(-1);
}
}
}
int main() {
choice();
return 0;
}